Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. # HTTP - redirect all requests to HTTPS
  2. server {
  3. listen 80;
  4. listen [::]:80 default_server ipv6only=on;
  5. server_name example.com;
  6. return 301 https://$host$request_uri;
  7. }
  8.  
  9. # HTTPS - serve HTML from /usr/share/nginx/html, proxy requests to /parse/
  10. # through to Parse Server
  11. server {
  12. listen 443;
  13. server_name example.com;
  14.  
  15. root /usr/share/nginx/html;
  16. index index.html index.htm;
  17.  
  18. ssl on;
  19. # Use certificate and key provided by Let's Encrypt:
  20. ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
  21. ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
  22. ssl_session_timeout 5m;
  23. ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  24. ssl_prefer_server_ciphers on;
  25. ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  26.  
  27. # Pass requests for /parse/ to Parse Server instance at localhost:1337
  28. location /parse/ {
  29. proxy_set_header X-Real-IP $remote_addr;
  30. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  31. proxy_set_header X-NginX-Proxy true;
  32. proxy_pass http://localhost:1337/;
  33. proxy_ssl_session_reuse off;
  34. proxy_set_header Host $http_host;
  35. proxy_redirect off;
  36. }
  37. location /test/ {
  38. proxy_set_header X-Real-IP $remote_addr;
  39. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  40. proxy_set_header X-NginX-Proxy true;
  41. proxy_pass http://localhost:1337/test/;
  42. proxy_ssl_session_reuse off;
  43. proxy_set_header Host $http_host;
  44. proxy_redirect off;
  45. }
  46. location /dashboard/ {
  47. proxy_set_header X-Real-IP $remote_addr;
  48. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  49. proxy_set_header X-NginX-Proxy true;
  50. proxy_pass http://localhost:4040/dashboard/;
  51. proxy_ssl_session_reuse off;
  52. proxy_set_header Host $http_host;
  53. proxy_redirect off;
  54. }
  55.  
  56. location / {
  57. try_files $uri $uri/ =404;
  58. }
  59. }
  60.  
  61. location /parse/ {
  62. proxy_set_header X-Real-IP $remote_addr;
  63. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  64. proxy_set_header X-NginX-Proxy true;
  65. proxy_pass http://localhost:1337/parse/;
  66. proxy_ssl_session_reuse off;
  67. proxy_set_header Host $http_host;
  68. proxy_redirect off;
  69. }
  70.  
  71. location /path/to/nginx/content {
  72. try_files $uri $uri/ =404;
  73. }
  74.  
  75. location /dashboard {
  76. proxy_set_header X-Real-IP $remote_addr;
  77. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  78. proxy_set_header X-NginX-Proxy true;
  79. proxy_pass http://localhost:4040/dashboard/;
  80. proxy_set_header Host $http_host;
  81. proxy_redirect off;
  82. }
  83.  
  84. location / {
  85. proxy_set_header X-Real-IP $remote_addr;
  86. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  87. proxy_set_header X-NginX-Proxy true;
  88. proxy_pass http://localhost:1337;
  89. proxy_set_header Host $http_host;
  90. proxy_redirect off;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement