Advertisement
Guest User

Untitled

a guest
Jan 26th, 2018
1,053
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. upstream app_server {
  2. server unix:/var/run/unicorn.sock fail_timeout=0;
  3. }
  4.  
  5. server {
  6. listen 443 ssl;
  7. listen [::]:443 ssl;
  8. root /home/rails/simplr/public;
  9. server_name example.com example1.com example2.com example3.com;
  10. index index.htm index.html;
  11.  
  12. location / {
  13. try_files $uri/index.html $uri.html $uri @app;
  14. }
  15.  
  16. 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)$ {
  17. try_files $uri @app;
  18. }
  19.  
  20. location @app {
  21. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  22. proxy_set_header Host $http_host;
  23. proxy_redirect off;
  24. proxy_pass http://app_server;
  25. }
  26.  
  27. location ~ /.well-known {
  28. allow all;
  29. }
  30.  
  31. ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
  32. ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
  33.  
  34. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  35. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  36.  
  37.  
  38. }
  39.  
  40. ## http://mydomain.com redirects to https://mydomain.com
  41. server {
  42. listen 80;
  43. listen [::]:80;
  44. server_name example.com example1.com example2.com example3.com;
  45.  
  46. include /etc/nginx/snippets/letsencrypt.conf;
  47.  
  48. location / {
  49. return 301 https://example.com$request_uri;
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement