Guest User

Untitled

a guest
Oct 21st, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. ssl_certificate /crt/ssl.crt;
  2. ssl_certificate_key /crt/ssl.key;
  3.  
  4. # redirect 80 to 443
  5. server {
  6. listen 80;
  7. return 301 https://$host$request_uri;
  8. }
  9.  
  10. # stop main domain access
  11. server {
  12. listen 443 ssl;
  13. server_name domain.com www.domain.com;
  14. ssl on;
  15.  
  16. location / {
  17. return 404;
  18. }
  19. }
  20.  
  21. # a service for example
  22. server {
  23. listen 443 ssl;
  24. server_name my.domain.com www.my.domain.com;
  25. ssl on;
  26.  
  27. location / {
  28. proxy_pass http://localhost:8000;
  29. }
  30. }
  31.  
  32. ssl_certificate /crt/ssl.crt;
  33. ssl_certificate_key /crt/ssl.key;
  34.  
  35. # redirect 80 to 443
  36. server {
  37. listen 80;
  38. return 301 https://$host$request_uri;
  39. }
  40.  
  41. # stop main domain access
  42. server {
  43. listen 443 ssl;
  44. server_name domain.com www.domain.com;
  45. ssl on;
  46.  
  47. location / {
  48. return 404;
  49. }
  50. }
  51.  
  52. # a service for example
  53. server {
  54. listen 443 ssl;
  55. server_name my.domain.com www.my.domain.com;
  56. ssl on;
  57.  
  58. location / {
  59. proxy_pass http://yourip:8096;
  60. }
  61. }
  62.  
  63. # redirect 80 to 443
  64. server {
  65. listen 80 default_server;
  66. return 301 https://$host$request_uri;
  67. }
Add Comment
Please, Sign In to add comment