Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 127.0.0.1:80 default_server;
- #listen [::1]:80 ipv6only=on;
- server_name localhost;
- ###############REWRITE RULES######################
- location / {
- if (!-e $request_filename){
- rewrite ^/office/([^/]*).css$ /t.php?gid=$1 last;
- rewrite ^/u/([^/]+)/profile/?$ /user/$1/ permanent;
- rewrite ^/u/([^/]+)/rss/?$ /userrss.php?user=$1 last;
- rewrite ^/u/([^/]+)/rss/([a-zA-Z0-9-]+)/?$ /userrss.php?user=$1&status=$2 last;
- rewrite ^/u/([^/]+)/edit/?$ /profile.php?login=$1 last;
- rewrite ^/u/([^/]+)/([^/]+)/?$ /user.php?view=$2&login=$1 last;
- rewrite ^/u/?$ /user.php last;
- rewrite ^/u/([^/]+)/?$ /user.php?login=$1 last;
- rewrite ^/profile/?$ /profile.php last;
- }
- if ($query_string ~* 'mosConfig_[a-zA-Z_]{1,21}(=|\%3D)' ){
- return 405;
- }
- if ($query_string ~* base64_encode.*\(.*\) ){
- return 405;
- }
- if ($query_string ~* (\<|%3C).*script.*(\>|%3E) ){
- return 405;
- }
- if ($query_string ~* 'GLOBALS(=|\[|\%[0-9A-Z]{0,2})' ){
- return 405;
- }
- if ($query_string ~* '_REQUEST(=|\[|\%[0-9A-Z]{0,2})' ){
- return 405;
- }
- if ($http_user_agent ~* ^pycurl/){
- return 405;
- }
- }
- #####END REWRITE################
- location ~* \.(css|js|gif|jpeg|png|jpg)$ {
- expires 168h;
- add_header Pragma public;
- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
- }
- rewrite_log on;
- root "c:/www/www/";
- autoindex on;
- allow 127.0.0.1;
- #allow ::1;
- deny all;
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- location ~ /\.ht {
- deny all;
- }
- location ~ \.php$ {
- try_files $uri =404;
- fastcgi_pass php_farm;
- include nginx.fastcgi.conf;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement