I have a MEAN project. I am using NGINX as reverse proxy. But I am stuck at a point and don't Understand. How NGINX reads all the assets, bundles(js,css....) from my project. And I don't want to give absolute path.
Please Help.....
Thanks in Advance
My Nginx config file is :
server{
listen 80;
listen 443 ssl;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
location / {
proxy_pass "127.0.0.1";
}
location /FannieMae/ {
root /var/www/apps/FanniMae/dist;
rewrite ^/FannieMae(.*) $1 break;
proxy_pass "127.0.0.1";
location ~ ^/(images/|img/|javascript/|js/|css/|stylesheets/|flash/|media/|static/|robots.txt|humans.txt|favicon.ico) {
root /var/www/apps/FanniMae/dist;
}
}
My typical NginX configuration (including websocket workaround) looks like:
map $http_upgrade $connection_upgrade { default upgrade; '' close; } upstream test { server 127.0.0.1:8100; } server { listen 80; listen 443 ssl; server_name test.some.domain www.test.some.domain; root c:/node/test/static; location / { try_files maintain.html $uri $uri/index.html @node; } location @node { proxy_pass http://test; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_max_temp_file_size 0; proxy_redirect off; proxy_read_timeout 120s; } }rootpoints to my static files directory and all that is not a file is delegated to Node.