Last active
August 29, 2015 14:21
-
-
Save khanimdad/e34a85afc5ab904fcce2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream mymster_server{ | |
# Path to Unicorn SOCK file, as defined previously | |
server unix:/var/www/mymster/shared/sockets/unicorn.sock; | |
} | |
server { | |
listen 80; | |
server_name mymster.com; | |
return 301 $scheme://www.mymster.com$request_uri; | |
} | |
upstream mymster{ | |
server unix:/var/www/mymster/shared/sockets/unicorn.sock; | |
} | |
server { | |
listen 80; | |
root /var/www/mymster/current/public; | |
# ssl on; | |
# ssl_certificate /etc/nginx/ssl/SSL.crt; | |
# ssl_certificate_key /etc/nginx/ssl/hailisys.key; | |
server_name www.mymster.com; | |
## Log Setting ## | |
access_log off;#/var/log/nginx/mymster_access.log combined; | |
error_log /var/log/nginx/mymster_error.log; | |
try_files $uri/index.html $uri.html $uri @mymster; | |
error_page 500 502 503 504 /500.html; | |
client_max_body_size 1024m; | |
keepalive_timeout 60; | |
strip on; | |
## gzip settings ## | |
gzip on; | |
#gzip_vary on; | |
gzip_buffers 50 8k; # compress response can't be > 50*8KB | |
gzip_proxied any; | |
gzip_disable "msie6"; | |
gzip_comp_level 6; # The higher the more usage of CPU | |
#gzip_types application/x-javascript text/css image/x-icon image/png image/jpeg image/gif; | |
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css; | |
## closed gzip setting ## | |
## Pagespeed settings ## | |
pagespeed on; | |
pagespeed RewriteLevel PassThrough; | |
pagespeed EnableFilters collapse_whitespace; | |
pagespeed EnableFilters recompress_images; | |
pagespeed EnableFilters lazyload_images; | |
pagespeed EnableFilters extend_cache; | |
pagespeed FileCachePath "/var/cache/ngx_pagespeed/"; | |
## Closed pagespeed settting ## | |
location ~* .(jpg|jpeg|mp3|eot|png|svg|ttf|woff|swf|gif|ico|css|js)(.*)$ { | |
gzip_static on; | |
expires 1d; | |
add_header Cache-Control public; | |
add_header ETag ""; | |
} | |
location @mymster { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://mymster; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment