Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server
- {
- server_name .domain.com;
- #rewrite ^ $scheme://domain.com$request_uri permanent;
- access_log /var/log/nginx/domain.com.access.log;
- error_log /var/log/nginx/domain.com.error.log;
- root /var/www/domain.com;
- index index.php index.html index.htm;
- client_max_body_size 10M;
- client_body_buffer_size 128k;
- location / {
- try_files $uri $uri/ /test1/index.php;
- #rewrite ^/test1/([A-Za-z0-9]+)?$ /test1/site/view/$1 redirect;
- #rewrite "/test1/([A-Za-z0-9]+)?" /test1/site/view/$1 break;
- #rewrite /test1/$1 ^/test1/site/view/([A-Za-z0-9])?$ break;
- #rewrite ^/test1/([A-Za-z0-9])?$ /test1/site/view/$1 break;
- rewrite ^/test1/s_(.+)$ /test1/images/small/$1 break;
- }
- #location /test1 {
- #rewrite s_^ /test1/images/small/$request_uri? permanent;
- #rewrite "/photos/([0-9] {2})([0-9] {2})([0-9] {2})" /path/to/photos/$1/$1$2/$1$2$3.png;
- #rewrite ^/(test1/images/small/.*)$ /test1/s_$1 break;
- #rewrite ^/(test1/.*)$ /test1/images/small/$1 break;
- #rewrite s_^ /test1/images/small/$request_uri? permanent;
- #rewrite ^/test1/s_(.+)$ /test1/images/small/$1;
- #rewrite ^/test1/(.+)$ /test1/site/view/$1 break;
- #}
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- }
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- # phpmyadmin
- location ^~ /phpmyadmin {
- root /usr/share/;
- index index.php index.html index.htm;
- location ~ ^/phpmyadmin/(.+\.php)$ {
- root /usr/share/;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
- root /usr/share/;
- }
- }
- location /phpMyAdmin {
- rewrite ^/* /phpmyadmin last;
- }
- ###################
- # 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;
- }
- # enforce www (exclude certain subdomains)
- if ($host !~* ^(www|subdomain|i))
- {
- rewrite ^/(.*)$ $scheme://www.$host/$1 permanent;
- }
- ###################
- # use fastcgi for all php files
- location ~* \.php$
- {
- try_files $uri /test1/index.php;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_split_path_info ^(.+\.php)(.*)$;
- fastcgi_param SCRIPT_FILENAME $document_root$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