Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name www.domain.co.uk m.domain.co.uk domain.static.co.uk;
- charset utf-8;
- access_log /var/log/nginx/domain-main/domain-main.access.log main;
- error_log /var/log/nginx/domain-main/domain-main.error.log notice;
- root /var/www/html/domain_main;
- location / {
- index index.php index.html index.htm;
- try_files $uri $uri/ /index.php?$args;
- client_max_body_size 20M;
- }
- error_page 404 /404.html;
- location = /404.html {
- root /usr/share/nginx/html;
- }
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /500.php;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- location ~ \.php$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- # set expires headers for images and serve blank gif for 404s
- location ~* \.(jpeg|jpg|gif|png|ico)$ {
- log_not_found off;
- expires 2d;
- error_page 404 /404-image.gif;
- }
- location /404-image.gif {
- root /usr/share/nginx/html;
- }
- location ~* \.(js|css)$ {
- #set 2 day cache time for static assets
- expires 2d;
- log_not_found off;
- }
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- location ~ /\.ht {
- deny all;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment