Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name dev.goprotect.ru;
- root /srv/dev/frontend/www;
- set $blog_path /srv/blog/wordpress;
- access_log /srv/dev_access.log;
- error_log /srv/dev_error.log;
- index index.html index.php;
- location /blog/ {
- alias /srv/blog/wordpress/;
- }
- location ~ /\.ht {
- deny all;
- }
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- }
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- location / {
- auth_basic "Unauthorized";
- auth_basic_user_file /srv/dev_passwd;
- try_files $uri $uri/ /index.php?$args;
- }
- location ~* /blog/(?:uploads|files)/.*\.php$ {
- deny all;
- }
- location ~ /blog/.*\.php$ {
- fastcgi_split_path_info ^/blog(.+\.php)(.*)$;
- #set $request_filename $blog_path$fastcgi_script_name;
- if (!-f $blog_path$fastcgi_script_name) {
- return 200 ["WTF?"]$blog_path$fastcgi_script_name[$request_filename][$request_uri][$document_uri];
- }
- #try_files $uri $uri/ /index.php?$args;
- # This is a robust solution for path info security issue and works with "cgi.fix_pathinfo = 1" in /etc/php.ini (default)
- #include /etc/nginx/fastcgi_params;
- fastcgi_param QUERY_STRING $query_string;
- fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param CONTENT_TYPE $content_type;
- fastcgi_param CONTENT_LENGTH $content_length;
- fastcgi_param SCRIPT_FILENAME $blog_path$fastcgi_script_name;
- fastcgi_param SCRIPT_NAME $fastcgi_script_name;
- fastcgi_param REQUEST_URI $request_uri;
- fastcgi_param DOCUMENT_URI $document_uri;
- fastcgi_param DOCUMENT_ROOT $blog_path;
- fastcgi_param SERVER_PROTOCOL $server_protocol;
- fastcgi_param GATEWAY_INTERFACE CGI/1.1;
- fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
- fastcgi_param REMOTE_ADDR $remote_addr;
- fastcgi_param REMOTE_PORT $remote_port;
- fastcgi_param SERVER_ADDR $server_addr;
- fastcgi_param SERVER_PORT $server_port;
- fastcgi_param SERVER_NAME $server_name;
- fastcgi_param HTTPS $https;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- fastcgi_param APPLICATION_ENV dev;
- }
- location ~ \.php$ {
- try_files $uri =404;
- fastcgi_param QUERY_STRING $query_string;
- fastcgi_param REQUEST_METHOD $request_method;
- fastcgi_param CONTENT_TYPE $content_type;
- fastcgi_param CONTENT_LENGTH $content_length;
- fastcgi_param SCRIPT_FILENAME $request_filename;
- fastcgi_param SCRIPT_NAME $fastcgi_script_name;
- fastcgi_param REQUEST_URI $request_uri;
- fastcgi_param DOCUMENT_URI $document_uri;
- fastcgi_param DOCUMENT_ROOT $document_root;
- fastcgi_param SERVER_PROTOCOL $server_protocol;
- fastcgi_param GATEWAY_INTERFACE CGI/1.1;
- fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
- fastcgi_param REMOTE_ADDR $remote_addr;
- fastcgi_param REMOTE_PORT $remote_port;
- fastcgi_param SERVER_ADDR $server_addr;
- fastcgi_param SERVER_PORT $server_port;
- fastcgi_param SERVER_NAME $server_name;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param APPLICATION_ENV dev;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement