Advertisement
Mochinov

Untitled

Nov 26th, 2020
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. [fcgi-program:asgi]
  2. # TCP socket used by Nginx backend upstream
  3. socket=tcp://localhost:8099
  4. # Directory where your site's project files are located
  5. directory=/home/alexander/registration_center/Doctor_at_home
  6.  
  7. # Each process needs to have a separate socket file, so we use process_num
  8. # Make sure to update "mysite.asgi" to match your project name
  9. command=/home/alexander/.pyenv/versions/regenv/bin/daphne -u /run/daphne/daphne%(process_num)d.sock --fd 0 --access-log - --proxy-headers Doctor_at_home.asgi$
  10.  
  11. # Number of processes to startup, roughly the number of CPUs you have
  12. numprocs=4
  13.  
  14. # Give each process a unique name so they can be told apart
  15. process_name=asgi%(process_num)d
  16.  
  17. # Automatically start and recover processes
  18. autostart=true
  19. autorestart=true
  20.  
  21. # Choose where you want your log to go
  22. stdout_logfile=/home/alexander/registration_center/Doctor_at_home/log/asgi.log
  23. redirect_stderr=true
  24.  
  25.  
  26.  
  27.  
  28.  
  29. Nginx
  30.  
  31. upstream channels-backend {
  32. server localhost:8099;
  33. }
  34. server {
  35. listen 80;
  36. server_name 176.124.136.34;
  37.  
  38. location = /favicon.ico { access_log off; log_not_found off; }
  39. location /static/ {
  40. root /home/alexander/registration_center/Doctor_at_home;
  41. }
  42.  
  43. location /media/ {
  44. root /home/alexander/registration_center/Doctor_at_home;
  45. }
  46.  
  47. location / {
  48. include proxy_params;
  49. proxy_pass http://0.0.0.0:8089;
  50. try_files $uri @proxy_to_app;
  51. }
  52. location @proxy_to_app {
  53. proxy_pass http://channels-backend;
  54.  
  55. proxy_http_version 1.1;
  56. proxy_set_header Upgrade $http_upgrade;
  57. proxy_set_header Connection "upgrade";
  58.  
  59. proxy_redirect off;
  60. proxy_set_header Host $host;
  61. proxy_set_header X-Real-IP $remote_addr;
  62. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  63. proxy_set_header X-Forwarded-Host $server_name;
  64. }
  65. }
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement