Advertisement
Guest User

nginx-config

a guest
Jun 7th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. ==================================NGINX CONFIG SITES-ENABLED==================
  2. # Let's Encrypt is setup elsewhere. It worked up until I deployed the React app
  3.  
  4. limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
  5.  
  6. server {
  7. limit_req zone=mylimit;
  8. # add_header 'Access-Control-Allow-Origin' '*'; # to test on my local machine
  9. listen 80;
  10. server_name 0.0.0.0;
  11. # return 301 https://www.website.com; # don't force a redirect
  12. location / {
  13. include proxy_params;
  14. proxy_pass http://127.0.0.1:8000; # port where Gunicorn is listening to
  15. proxy_http_version 1.1;
  16.  
  17. }
  18. }
  19.  
  20. server {
  21. limit_req zone=mylimit;
  22. # add_header 'Access-Control-Allow-Origin' '*'; # to test on my local machine
  23. listen 443 default ssl;
  24. server_name website www.website.com;
  25. location / {
  26. include proxy_params;
  27. proxy_pass http://127.0.0.1:8000; # port where Gunicorn is listening to
  28. proxy_http_version 1.1;
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement