Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /etc/nginx/sites-enabled/default
- server {
- listen 80 default_server;
- listen [::]:80 default_server ipv6only=on;
- root /usr/share/nginx/html;
- index index.html index.htm;
- # Make site accessible from http://localhost/
- server_name localhost;
- location / {
- # First attempt to serve request as file, then
- # as directory, then fall back to displaying a 404.
- try_files $uri $uri/ =404;
- # Uncomment to enable naxsi on this location
- # include /etc/nginx/naxsi.rules
- }
- # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
- #location /RequestDenied {
- # proxy_pass http://127.0.0.1:8080;
- #}
- #error_page 404 /404.html;
- # redirect server error pages to the static page /50x.html
- #
- #error_page 500 502 503 504 /50x.html;
- #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_split_path_info ^(.+\.php)(/.+)$;
- # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
- #
- # # With php5-cgi alone:
- # fastcgi_pass 127.0.0.1:9000;
- # # With php5-fpm:
- # fastcgi_pass unix:/var/run/php5-fpm.sock;
- # fastcgi_index index.php;
- # include fastcgi_params;
- #}
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- #location ~ /\.ht {
- # deny all;
- #}
- }
- upstream wsgi_mydomain.ru {
- server unix:/srv/socks/mydomain.ru.sock;
- }
- /etc/nginx/sites-enabled/mydomain.conf
- server {
- listen 80;
- server_name mydomain.ru;
- charset utf8;
- autoindex off;
- access_log /srv/logs/mydomain.ru_access.log;
- error_log /srv/logs/mydomain.ru_error.log error;
- set $project_home /srv/www/mydomain.ru;
- set $media_home /srv/www/httpdocs;
- root $project_home;
- location / {
- root $project_home;
- try_files $uri @webadm;
- }
- location /images {
- root $media_home/media;
- expires 1w;
- }
- location /img {
- root $media_home/media;
- expires 1w;
- }
- location /css {
- root $media_home/media;
- expires 1d;
- }
- location /js {
- root $media_home/media;
- expires 1d;
- }
- location /fonts {
- root $media_home/media;
- expires 1w;
- }
- location /files {
- root $media_home/media;
- expires 1w;
- }
- location /static {
- root $media_home;
- expires 1d;
- }
- location /media {
- root $media_home;
- expires 1w;
- }
- gzip on;
- gzip_min_length 1000;
- gzip_proxied expired no-cache no-store private auth;
- gzip_disable "MSIE [1-6]\.(?!.*SV1)";
- gzip_static on;
- gzip_types text/plain application/xml text/css application/javascript application/x-javascript text/javascript application/x-woff image/gif image/jpeg image/pjpeg image/png;
- location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|css|js)$ {
- expires 7d;
- }
- location @webadm {
- uwsgi_pass wsgi_mydomain.ru;
- uwsgi_read_timeout 2400;
- include uwsgi_params;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment