Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name 192.168.1.2;
- root /usr/local/nginx/html;
- index index.php index.html index.htm;
- access_log /var/log/nginx/xopom.access.log main;
- error_log /var/log/nginx/xopom.error.log;
- location / {
- try_files $uri $uri/ @rewrites;
- }
- location @rewrites {
- if ($uri !~ "^/file/.*"){
- set $rule_0 1$rule_0;
- }
- if ($uri !~ "^/install/.*"){
- set $rule_0 2$rule_0;
- }
- if ($uri !~ "^/design/.*"){
- set $rule_0 3$rule_0;
- }
- if ($uri !~ "^/plugins/.*"){
- set $rule_0 4$rule_0;
- }
- #if ($uri !~ "^/index.php"){
- # set $rule_0 5$rule_0;
- #}
- if ($uri !~ "^/robots.txt"){
- set $rule_0 6$rule_0;
- }
- if ($uri !~ "^/favicon.ico"){
- set $rule_0 7$rule_0;
- }
- if ($uri !~ "^/mochi.html"){
- set $rule_0 8$rule_0;
- }
- if ($rule_0 = "87654321"){
- rewrite ^/(.*)$ /index.php?do=/$1 last;
- }
- rewrite ^/file/music_folder/([0-9a-z_]+).([a-z0-9]+)$ /index.php?do=/data/module_music/file_$1/type_$2 last;
- rewrite ^/file/videos/src/([0-9a-z_]+).([a-z0-9]+)$ /index.php?do=/data/module_video/file_$1/type_$2 last;
- rewrite ^/file/pic/gallery/([0-9a-z_]+).([a-z]+)$ /index.php?do=/data/module_gallery/file_$1/type_$2 last;
- rewrite ^/file/pic/gallery/thumb/([0-9a-z]+).([a-z]+)$ /index.php?do=/data/module_gallery-thumb/file_$1/type_$2 last;
- rewrite ^/file/pic/groups/gallery/([0-9a-z_]+).([a-z]+)$ /index.php?do=/data/module_groups/file_$1/type_$2 last;
- if ($uri !~ "^/file/.*"){
- set $rule_6 1$rule_6;
- }
- if ($uri !~ "^/install/.*"){
- set $rule_6 2$rule_6;
- }
- if ($uri !~ "^/design/.*"){
- set $rule_6 3$rule_6;
- }
- if ($uri !~ "^/plugins/.*"){
- set $rule_6 4$rule_6;
- }
- if ($uri !~ "^/mochi.html"){
- set $rule_6 5$rule_6;
- }
- if ($rule_6 = "54321"){
- rewrite ^/index.php(/.*)$ /index.php?do=$1 last;
- }
- }
- location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
- expires max;
- }
- location = /robots.txt { access_log off; log_not_found off; }
- location = /favicon.ico { access_log off; log_not_found off; }
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- location ~ \.php$ {
- root /usr/local/nginx/html;
- fastcgi_pass unix:/var/run/php5-fpm.sock;
- fastcgi_index index.php;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
- }
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- location ~ /\.ht {
- deny all;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement