title: Trouble setting up NGINX behind pfSense Router
body: <p>I'm attempting to setup an NGINX reverse proxy on my network, it is currently running on an Ubuntu VM. I'd like to run a website running in IIS, and another site running on Apache in a Linux VM behind the same public IP address. NGINX seemed like the perfect solution. </p>
  
  <p>I've followed several guides and can't seem to get everything working. The NGINX config seems to work locally if I access the NGINX VM's IP directly it serves me the default config, and I can even change it between the IIS site, or the Apache site, and get it to work locally. My problem comes in with any external connection. </p>
  
  <p>Previously my pfSense router was setup to forward port 80 and 443 to the IIS VM, and that was working fine, so I know at a basic level that pfSense was able to forward those ports to that windows client. Once I got NGINX setup I changed my port forwards for 80 and 443 to point to the VM running NGINX. Now none of my websites will work, the ip address for the domains resolves to my public IP, but the requests time out / never reach any web server. </p>
  
  <p>nginx.conf is the default, I made no changes.</p>
  
  <p><strong>default nginx host conf:</strong></p>
  
  <pre><code>server {
      listen 80 default_server;
      listen [::]:80 default_server;
  
      root /var/www/html;
  
      index index.html index.htm index.nginx-debian.html;
  
      server_name _;
  
      location / {
          return 404;
      }
  }
  </code></pre>
  
  <p><strong>Apache host conf:</strong> </p>
  
  <pre><code>server {
          listen 80;
          server_name domain.com;
  
          location / {
                  proxy_pass http://0.0.0.0:80; # Apache internal IP
                  proxy_set_header Host $host;
                  proxy_set_header X-Real-IP $remote_addr;
                  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   }
  }
  </code></pre>
  
  <p><strong>pfSense Port 80 Rule:</strong></p>
  
  <pre><code>Action: Pass
  Interface: WAN
  Address Family: IPv4
  Protocol: TCP
  Source: Any
  Destination: NGINX VM IP 
  From: 80
  To: 80
  </code></pre>
  
  <p>I'm not getting any error messages in the console, in the NGINX log, etc. I'm honestly at a loss. Any advice would be greatly appreciated. </p>