How to make BrowserSync work with an nginx proxy server?

后端 未结 4 1552
北荒
北荒 2020-12-13 16:10

(If needed, please see my last question for some more background info.)

I\'m developing an app that uses a decoupled front- and backend:

  • The backend is
4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-13 16:32

    Setup for browser-sync to work with python (django) app that runs on uwsgi via websocket. Django app is prefixed with /app to generate url that looks like http://example.com/app/admin/

    server {
      listen 80;
      server_name example.com;
    
      charset utf-8;
    
      root /var/www/example/htdocs/static;
      index index.html index.htm;
    
      try_files $uri $uri/ /index.html?$args;
    
      location /app {
        ## uWSGI setup
        include     /etc/nginx/uwsgi_params;
        uwsgi_pass  unix:///var/run/example/uwsgi.sock;
        uwsgi_param SCRIPT_NAME /app;
        uwsgi_modifier1 30;
      }
    
      location /media  {
        alias /var/www/example/htdocs/storage;
      }
    
      location /static {
        alias /var/www/example/htdocs/static;
      }
    
    }
    

提交回复
热议问题