NGINX and Angular 2

前端 未结 4 902
Happy的楠姐
Happy的楠姐 2020-12-05 11:06

My current app users routes like this /myapp/, /myapp//, /myaapp/dept/

My app is currently deployed in an internal http server with NGINX. The other server that acce

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-05 11:30

    I just had this same issue and found a solution. My base href is "/", however.

    Below is my nginx.conf:

    worker_processes  1;
    
    events {
        worker_connections  1024;
    }
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
    
        server {
            listen       80;
            server_name  mysite.com www.mysite.com;
            root /usr/share/nginx/html;
    
            location / {
                try_files $uri$args $uri$args/ /index.html;
            }
        }
    }
    

提交回复
热议问题