Advertisement
Guest User

NGINX conf

a guest
Aug 5th, 2023
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.51 KB | None | 0 0
  1. # /etc/nginx/nginx.conf
  2.  
  3. events {
  4. # Use the default settings for the events section
  5. }
  6.  
  7. http {
  8. # Define any global settings for the HTTP section here if needed
  9. # For example, you can set default types and access log settings
  10.  
  11. server {
  12. server_name build.steamexchange.io localhost;
  13. proxy_http_version 1.1;
  14.  
  15. location / {
  16. proxy_pass http://localhost:3000;
  17. add_header Content-Security-Policy "default-src 'self' data: blob:; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src * data: blob:; font-src * data: blob:; frame-src *;";
  18. }
  19.  
  20. location /socket/v2 {
  21. proxy_pass http://localhost:4000;
  22. proxy_http_version 1.1;
  23. proxy_set_header Upgrade $http_upgrade;
  24. proxy_set_header Connection "Upgrade";
  25. proxy_set_header Host $host;
  26. }
  27.  
  28. location /api/ {
  29. proxy_pass http://localhost:4000/api;
  30. }
  31.  
  32. listen 443 ssl; # managed by Certbot
  33. ssl_certificate /etc/letsencrypt/live/build.steamexchange.io/fullchain.pem; # managed by Certbot
  34. ssl_certificate_key /etc/letsencrypt/live/build.steamexchange.io/privkey.pem; # managed by Certbot
  35. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  36. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  37.  
  38. }
  39.  
  40. server {
  41. listen 81;
  42. server_name localhost;
  43. proxy_http_version 1.1;
  44. proxy_hide_header Access-Control-Allow-Origin;
  45. proxy_hide_header Access-Control-Allow-Methods;
  46. add_header 'Access-Control-Allow-Origin' 'http://localhost' always;
  47. add_header 'Access-Control-Allow-Methods' 'PUT, GET, POST, OPTIONS, DELETE, PATCH' always;
  48.  
  49. location / {
  50. proxy_pass http://localhost:4000;
  51. }
  52.  
  53. location /auth {
  54. proxy_pass http://localhost:4000;
  55. proxy_http_version 1.1;
  56. proxy_set_header Upgrade $http_upgrade;
  57. proxy_set_header Connection "Upgrade";
  58. proxy_set_header Host $host;
  59. }
  60.  
  61. location /socket {
  62. proxy_pass http://localhost:4000;
  63. proxy_http_version 1.1;
  64. proxy_set_header Upgrade $http_upgrade;
  65. proxy_set_header Connection "Upgrade";
  66. proxy_set_header Host $host;
  67. }
  68. }
  69.  
  70. server {
  71. listen 82;
  72. server_name localhost;
  73. proxy_http_version 1.1;
  74. proxy_hide_header Access-Control-Allow-Origin;
  75. proxy_hide_header Access-Control-Allow-Methods;
  76. add_header 'Access-Control-Allow-Origin' 'http://localhost' always;
  77. add_header 'Access-Control-Allow-Credentials' 'true' always;
  78. add_header 'Access-Control-Allow-Methods' 'PUT, GET, POST, OPTIONS, DELETE, PATCH' always;
  79.  
  80. location / {
  81. proxy_pass http://localhost:8050;
  82. }
  83.  
  84. location /socket/v2 {
  85. proxy_pass http://localhost:4000;
  86. proxy_http_version 1.1;
  87. proxy_set_header Upgrade $http_upgrade;
  88. proxy_set_header Connection "Upgrade";
  89. proxy_set_header Host $host;
  90. }
  91. }
  92.  
  93.  
  94. server {
  95. if ($host = build.steamexchange.io) {
  96. return 301 https://$host$request_uri;
  97. } # managed by Certbot
  98.  
  99.  
  100. listen 80;
  101. server_name build.steamexchange.io localhost;
  102. return 404; # managed by Certbot
  103.  
  104.  
  105. }}
  106.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement