Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- server_name www.sitename.com;
- rewrite ^(.*) http://sitename.com$1 permanent;
- }
- server {
- listen 80;
- server_name sitename.com;
- root /var/www/sitename.com/htdocs/blog;
- index index.php;
- include /etc/nginx/security;
- # Logging --
- access_log off;
- error_log /var/log/nginx/sitename.com.error.log warn;
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- }
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- # serve static files directly
- location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
- access_log off;
- expires max;
- }
- location /api {
- try_files $uri $uri/ /index.php?$args;
- root /var/www/sitename.com/htdocs;
- index index.php;
- location ~ \.php$ {
- try_files $uri $uri/ /index.php?$args;
- fastcgi_pass unix:/var/run/php5-fpm/sitename.com.socket;
- fastcgi_index index.php;
- include /etc/nginx/fastcgi_params;
- }
- }
- location ~ \.php$ {
- try_files $uri $uri/ /index.php?$args;
- fastcgi_pass unix:/var/run/php5-fpm/sitename.com.socket;
- fastcgi_index index.php;
- include /etc/nginx/fastcgi_params;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement