Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server
- {
- server_name .example.com;
- access_log /var/log/nginx/example.com.access.log;
- root /var/www/example.com/html;
- index index.php index.html index.htm;
- if ($host ~* ^www\.(.*))
- {
- set $host_without_www $1;
- rewrite ^/(.*)$ $scheme://$host_without_www/$1 permanent;
- }
- if ($request_uri ~* ^(/welcome(/index)?|/index(.php)?)/?$)
- {
- rewrite ^(.*)$ / permanent;
- }
- if ($request_uri ~* index/?$)
- {
- rewrite ^/(.*)/index/?$ /$1 permanent;
- }
- if (!-d $request_filename)
- {
- rewrite ^/(.+)/$ /$1 permanent;
- }
- if ($request_uri ~* ^/system)
- {
- rewrite ^/(.*)$ /index.php?/$1 last;
- break;
- }
- if (!-e $request_filename)
- {
- rewrite ^/(.*)$ /index.php?/$1 last;
- break;
- }
- # catch all
- error_page 404 /index.php;
- # use fastcgi for all php files
- location ~ \.php$
- {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /var/www/example.com/html$fastcgi_script_name;
- include fastcgi_params;
- }
- # deny access to apache .htaccess files
- location ~ /\.ht
- {
- deny all;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement