Advertisement
Guest User

Untitled

a guest
Dec 16th, 2022
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. worker_processes 4;
  2.  
  3. events {
  4. worker_connections 1024;
  5. multi_accept on;
  6. use epoll;
  7. }
  8.  
  9. http {
  10.  
  11. charset utf-8;
  12. sendfile on;
  13. tcp_nopush on;
  14. tcp_nodelay on;
  15. keepalive_timeout 0;
  16. types_hash_max_size 2048;
  17. server_tokens off;
  18. client_body_timeout 300;
  19. client_header_timeout 300;
  20. client_max_body_size 64m;
  21. send_timeout 300;
  22. fastcgi_buffer_size 128k;
  23. fastcgi_buffers 256 128k;
  24. fastcgi_send_timeout 900s;
  25. fastcgi_read_timeout 900s;
  26. proxy_read_timeout 900;
  27. proxy_ignore_client_abort on;
  28. uwsgi_buffer_size 32k;
  29. uwsgi_buffers 8 32k;
  30. uwsgi_busy_buffers_size 32k;
  31. uwsgi_read_timeout 900;
  32. uwsgi_send_timeout 900;
  33. uwsgi_connect_timeout 60;
  34.  
  35. client_header_buffer_size 10k;
  36. large_client_header_buffers 16 10k;
  37.  
  38. ignore_invalid_headers on;
  39. underscores_in_headers on;
  40.  
  41. include /etc/nginx/mime.types;
  42. default_type application/octet-stream;
  43.  
  44. ##
  45. # Logging Settings
  46. ##
  47.  
  48. access_log /var/log/nginx/access.log;
  49. error_log /var/log/nginx/error.log;
  50.  
  51. ##
  52. # Gzip Settings
  53. ##
  54.  
  55. gzip on;
  56. gzip_disable "msie6";
  57.  
  58. gzip_vary on;
  59. gzip_proxied any;
  60. gzip_comp_level 7;
  61. gzip_buffers 64 8k;
  62. #gzip_min_length 1024;
  63. gzip_http_version 1.1;
  64. gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
  65.  
  66. upstream gunicorn {
  67. server backend:8000;
  68. }
  69.  
  70. server {
  71. listen 8080;
  72. listen [::]:8080;
  73. server_name anamazingwizard.com www.anamazingwizard.com;
  74. root /usr/share/nginx/html/react;
  75.  
  76. location ~ /.well-known/acme-challenge/ {
  77. allow all;
  78. }
  79.  
  80. location / {
  81. add_header "Access-Control-Allow-Origin" "*";
  82. add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
  83. add_header 'Access-Control-Allow-Headers' 'X-Requested-With,Accept,Content-Type, Origin';
  84. index index.html;
  85. try_files $uri /index.html$is_args$args =404;
  86. }
  87.  
  88. location /api/ {
  89. try_files $uri @proxy_api;
  90. }
  91. location /admin/ {
  92. try_files $uri @proxy_api;
  93. }
  94.  
  95. location @proxy_api {
  96. proxy_set_header X-Forwarded-Proto https;
  97. proxy_set_header X-Url-Scheme $scheme;
  98. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  99. proxy_set_header Host $http_host;
  100. proxy_redirect off;
  101. proxy_pass http://gunicorn;
  102. }
  103.  
  104. location /apps_static/ {
  105. autoindex on;
  106. alias /anamazingwizard/apps_static/;
  107. }
  108.  
  109. location /media/ {
  110. autoindex on;
  111. alias /anamazingwizard/public/uploads/;
  112. }
  113. }
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement