Guest User

Untitled

a guest
Mar 4th, 2022
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. upstream puma_server {
  2. server unix:/home/deploy/docs-central/tmp/puma.sock fail_timeout=0;
  3. }
  4.  
  5. server {
  6. if ($host = www.docs.swagger.example.com) {
  7. return 301 https://$server_name$request_uri;
  8. }
  9.  
  10. if ($host = docs.swagger.example.com) {
  11. return 301 https://$server_name$request_uri;
  12. }
  13.  
  14. server_name docs.swagger.example.com www.docs.swagger.example.com;
  15. }
  16.  
  17. server {
  18. listen 443 ssl http2;
  19. server_name docs.swagger.example.com www.docs.swagger.example.com;
  20.  
  21. # SSL
  22. ssl_trusted_certificate /etc/letsencrypt/live/docs.swagger.example.com/chain.pem;
  23. ssl_certificate /etc/letsencrypt/live/docs.swagger.example.com/fullchain.pem;
  24. ssl_certificate_key /etc/letsencrypt/live/docs.swagger.example.com/privkey.pem;
  25. include snippets/ssl-config.conf;
  26.  
  27. location / {
  28. proxy_pass http://puma_server;
  29. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  30. proxy_set_header Host $http_host;
  31. }
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment