Created
November 13, 2017 03:27
-
-
Save YuriFontella/30bb9f2f3c08516bdb38bcdb0af66a8e to your computer and use it in GitHub Desktop.
nginx configuration simple ssl
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 logs/error.log; | |
| error_log logs/error.log notice; | |
| error_log logs/error.log info; | |
| pid logs/nginx.pid; | |
| worker_rlimit_nofile 8192; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| passenger_root /usr/lib/ruby/gems/2.4.0/gems/passenger-5.1.5; | |
| passenger_ruby /usr/bin/ruby; | |
| ssl_session_cache shared:SSL:10m; | |
| ssl_session_timeout 10m; | |
| ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
| ssl_ciphers HIGH:!aNULL:!MD5; | |
| include mime.types; | |
| default_type application/octet-stream; | |
| log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | |
| '$status $body_bytes_sent "$http_referer" ' | |
| '"$http_user_agent" "$http_x_forwarded_for"'; | |
| access_log logs/access.log; | |
| sendfile on; | |
| tcp_nopush on; | |
| keepalive_timeout 70; | |
| gzip on; | |
| server { | |
| listen 80; | |
| server_name api.socialanimeclub.com; | |
| return 301 https://$server_name$request_uri; | |
| } | |
| server { | |
| listen 443 ssl; | |
| server_name api.socialanimeclub.com; | |
| ssl_certificate /etc/nginx/ssl_certs/api.socialanimeclub.crt; | |
| ssl_certificate_key /etc/nginx/ssl_certs/api.socialanimeclub.key; | |
| passenger_enabled on; | |
| rails_env production; | |
| passenger_app_root /srv/http/rails; | |
| location / { | |
| root /srv/http/rails/public; | |
| } | |
| error_page 500 502 503 504 /50x.html; | |
| location = /50x.html { | |
| root html; | |
| } | |
| } | |
| server { | |
| listen 80; | |
| server_name socialanimeclub.com; | |
| return 301 https://$server_name$request_uri; | |
| } | |
| server { | |
| listen 443 ssl; | |
| server_name socialanimeclub.com; | |
| ssl_certificate /etc/nginx/ssl_certs/socialanimeclub.crt; | |
| ssl_certificate_key /etc/nginx/ssl_certs/socialanimeclub.key; | |
| root /srv/http/angular/dist; | |
| location ~* \.(?:css|js|mp4|mkv|jpg|png|gif|jpeg|vtt)$ { | |
| expires max; | |
| access_log off; | |
| add_header Cache-Control "public"; | |
| } | |
| location / { | |
| proxy_pass http://158.69.93.247:8080; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment