Created
February 29, 2016 23:23
-
-
Save YuriFontella/a2869aa95afecbc640e8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
worker_processes 2; | |
error_log /opt/nginx/logs/error.log; | |
pid /opt/nginx/logs/nginx.pid; | |
events { | |
use epoll; | |
worker_connections 1024; | |
} | |
http { | |
client_max_body_size 25m; | |
client_body_buffer_size 128k; | |
client_body_temp_path /opt/nginx/client_body_temp; | |
passenger_root /var/lib/gems/2.1.0/gems/passenger-5.0.23; | |
passenger_ruby /usr/bin/ruby2.1; | |
passenger_pool_idle_time 0; | |
passenger_max_pool_size 15; | |
passenger_pre_start https://www.wiblisten.com/; | |
include mime.types; | |
default_type application/octet-stream; | |
server_tokens off; | |
sendfile on; | |
keepalive_timeout 70; | |
gzip on; | |
gzip_http_version 1.1; | |
gzip_disable "msie6"; | |
gzip_vary on; | |
gzip_min_length 1100; | |
gzip_buffers 64 8k; | |
gzip_comp_level 3; | |
gzip_proxied any; | |
gzip_types text/plain text/css application/x-javascript text/xml application/xml; | |
ssl_certificate /opt/nginx/ssl_certs/www.wiblisten.com.crt; | |
ssl_certificate_key /opt/nginx/ssl_certs/ssl.key; | |
ssl_session_timeout 15m; | |
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; | |
ssl_ciphers RC4:HIGH:!aNULL:!MD5; | |
ssl_prefer_server_ciphers on; | |
ssl_session_cache shared:SSL:10m; | |
add_header Strict-Transport-Security "max-age=16070400; includeSubdomains"; | |
add_header X-Frame-Options DENY; | |
limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s; | |
server { | |
listen 80; | |
server_name *.wiblisten.com; | |
rewrite ^(.*) https://$host$1 permanent; | |
location ~ \.(php|html)$ { | |
deny all; | |
} | |
access_log /dev/null; | |
error_log /dev/null; | |
} | |
server { | |
ssl on; | |
listen 443 default ssl; | |
server_name *.wiblisten.com; | |
root /media/yuri/Backup/html/wiblisten/public; | |
passenger_enabled on; | |
passenger_min_instances 5; | |
rails_env development; | |
limit_req zone=one burst=5; | |
access_log /opt/nginx/logs/access.log; | |
error_page 500 502 504 /500.html; | |
error_page 503 @503; | |
location = /50x.html { | |
root html; | |
} | |
location = /404.html { | |
root html; | |
} | |
location @503 { | |
error_page 405 = /system/maintenance.html; | |
if (-f $document_root/system/maintenance.html) { | |
rewrite ^(.*)$ /system/maintenance.html break; | |
} | |
rewrite ^(.*)$ /503.html break; | |
} | |
if ($request_method !~ ^(GET|HEAD|PUT|POST|DELETE|OPTIONS)$ ){ | |
return 405; | |
} | |
if (-f $document_root/system/maintenance.html) { | |
return 503; | |
} | |
location ~ ^/(assets|images|javascripts|stylesheets|swfs|system)/ { | |
gzip_static on; | |
expires max; | |
add_header Cache-Control public; | |
add_header Last-Modified ""; | |
add_header ETag ""; | |
break; | |
} | |
location = /favicon.ico { | |
expires max; | |
add_header Cache-Control public; | |
} | |
location ~ \.(php|html)$ { | |
return 405; | |
} | |
access_log /dev/null; | |
error_log /dev/null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment