Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server
- {
- listen 80 default;
- server_name .domain.com;
- access_log off;
- #access_log /var/log/nginx/domain.com.access.log;
- error_log /var/log/nginx/domain.com.error.log;
- index index.php index.html index.htm;
- client_max_body_size 300M;
- #client_body_buffer_size 128k;
- root /var/www/domain.com/html;
- expires 0;
- location ^~ /progress {
- # report uploads tracked in the 'proxied' zone
- report_uploads proxied;
- }
- location / {
- proxy_pass http://127.0.0.1;
- proxy_redirect default;
- try_files $uri $uri/ /index.php;
- # down page
- if (-f $document_root/down.html) {
- return 503;
- }
- track_uploads proxied 30s;
- }
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- }
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- # removes trailing "index" from all controllers
- if ($request_uri ~* index/?$)
- {
- rewrite ^/(.*)/index/?$ /$1 permanent;
- }
- # removes trailing slashes (prevents SEO duplicate content issues)
- if (!-d $request_filename)
- {
- rewrite ^/(.+)/$ /$1 permanent;
- }
- # use fastcgi for all php files
- location ~* \.php$
- {
- try_files $uri /index.php;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_read_timeout 600s;
- fastcgi_split_path_info ^(.+\.php)(.*)$;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- # enforce NO www
- if ($host ~* ^www\.(.*))
- {
- set $host_without_www $1;
- rewrite ^/(.*)$ http://domain.com/$1 permanent;
- }
- # deny access to apache .htaccess files
- location ~ /\.ht
- {
- deny all;
- }
- error_page 503 @maintenance;
- location @maintenance {
- rewrite ^(.*)$ /down.html break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement