You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
815 B

  1. map $http_host $python_upstream {
  2. someproject.local.wpstudio.ru http://python-someproject:8000;
  3. }
  4. map $http_host $python_root {
  5. someproject.local.wpstudio.ru /usr/share/nginx/python/someproject;
  6. }
  7. server {
  8. listen 80;
  9. server_name
  10. someproject.local.wpstudio.ru
  11. ;
  12. location / {
  13. resolver 127.0.0.11;
  14. proxy_pass $python_upstream;
  15. proxy_set_header Upgrade $http_upgrade;
  16. proxy_set_header Connection 'upgrade';
  17. proxy_set_header Host $host;
  18. }
  19. root $python_root;
  20. location @media_proxy {
  21. proxy_pass $uploads_upstream;
  22. proxy_ssl_server_name on;
  23. }
  24. location ~ /media {
  25. root $python_root;
  26. try_files $uri @media_proxy;
  27. expires max;
  28. }
  29. location ~ /static {
  30. expires max;
  31. }
  32. }