Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- upstream app_server {
- server unix:/var/run/unicorn.sock fail_timeout=0;
- }
- server {
- listen 443 ssl;
- listen [::]:443 ssl;
- root /home/rails/simplr/public;
- server_name example.com example1.com example2.com example3.com;
- index index.htm index.html;
- location / {
- try_files $uri/index.html $uri.html $uri @app;
- }
- location ~* ^.+\.(jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|flv|mpeg|avi)$ {
- try_files $uri @app;
- }
- location @app {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- proxy_pass http://app_server;
- }
- location ~ /.well-known {
- allow all;
- }
- ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
- include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
- }
- ## http://mydomain.com redirects to https://mydomain.com
- server {
- listen 80;
- listen [::]:80;
- server_name example.com example1.com example2.com example3.com;
- include /etc/nginx/snippets/letsencrypt.conf;
- location / {
- return 301 https://example.com$request_uri;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement