Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name site.ru www.site.ru;
- root /var/www/valhalla/site.ru;
- access_log /var/log/nginx/site.ru-access.log;
- error_log /var/log/nginx/site.ru-error.log;
- index index.php index.html;
- rewrite_log on;
- if ($host != 'site.ru' ) {
- rewrite ^/(.*)$ http://site.ru/$1 permanent;
- }
- location ~* ^/core/ {
- deny all;
- }
- location /api.js {
- deny all;
- }
- location / {
- try_files $uri $uri/ @rewrite;
- }
- location /index.html {
- rewrite / / permanent;
- }
- location ~ ^/(.*?)/index\.html$ {
- rewrite ^/(.*?)/ // permanent;
- }
- location @rewrite {
- rewrite ^/(.*)$ /index.php?q=$1;
- }
- location ~ \.php$ {
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_pass backend-valhalla;
- }
- location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|bmp)$ {
- access_log off;
- expires 10d;
- break;
- }
- location ~ /\.ht {
- deny all;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement