Trying to get nginx to proxy my node.js app and use a domain with it. I'm going to have many domains mapped to the server so i'm using separate .conf files for each server block. The issue i'm having right now is that I can only seem to get the default nginx page to show up when i go to the domain. I'll try to explain the current setup as clearly as possible, and if you need any more information please let me know.
nginx.conf changes
I set the root path to where my apps files are, root /var/www; so for example, an app would be deployed to the folder /var/www/example.com.
server block config
I created a new file for the server block /etc/nginx/conf.d/example_com.conf which contains
server { listen 80; listen [::]:80; server_name example.com www.example.com; location /var/www { proxy_pass http://localhost:3103; include /etc/nginx/proxy_params; } } please note that going to my http://myip:3103 renders the app as it should and the file /etc/nginx/proxy_params contains
proxy_buffers 16 32k; proxy_buffer_size 64k; proxy_busy_buffers_size 128k; proxy_cache_bypass $http_pragma $http_authorization; proxy_connect_timeout 59s; proxy_hide_header X-Powered-By; proxy_http_version 1.1; proxy_ignore_headers Cache-Control Expires; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_404; proxy_no_cache $http_pragma $http_authorization; proxy_pass_header Set-Cookie; proxy_read_timeout 600; proxy_redirect off; proxy_send_timeout 600; proxy_temp_file_write_size 64k; proxy_set_header Accept-Encoding ''; proxy_set_header Cookie $http_cookie; proxy_set_header Host $host; proxy_set_header Proxy ''; proxy_set_header Referer $http_referer; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Original-Request $request_uri; Is there anything I am doing wrong here? Do you need any more info? Please let me know! nginx is pretty new for me and i feel like i'm super close i'm just note understanding something. Thanks!