This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Access local webserver fails.

I have a local Apache webserver hosting multiple websites from one IP address. It's at 192.168.1.100. I'm not using WAF. I followed the directions below:


1) Click on Network Protection
2) Click on the NAT tab
3) Click on 'New NAT Rule'
4) Under 'Matching Condition', at 'Using Service:', click the trash can, then the Green Plus. In the Destination Port, enter 80. Click Save.
5) Under 'Matching Condition', at 'Going To', click the trash can, then the folder. Options show up on the left. click and hold on 'External (WAN) (Adddress)', and drag it to the empty space next to 'Going To'. Click Save.
6) Under 'Action', 'Change the destination to:', click the trash can, then the Green Plus. Leave everything default, and add 192.168.1.100 into the IPv4 Address box. Click Save
7) Under 'Action', 'And the service to:', click the trash can, then the Green Plus. Under Destination Port, enter 80.
8) Check the box 'Automatic Firewall Rule'.
9) If you want, fill in a description of the rule in 'Comment:'
10) Click Save
11) Under the Status column, make sure there is a green checkmark. If not, click on the grey circle next to the red X.

Then,

Network Protection, NAT, NAT tab
New NAT Rule
Rule Type: Full NAT (Source + Destination)
For traffic from: Internal (Network)
Using service: HTTP
Going to: External (WAN)(Address)
Change the destination to: 192.168.1.100
And the service to: HTTP
Change the source to: Internal (Address)
And the service to: HTTP
Keep unchecked 'Automatic Firewall Rule'
Save 

When I go to http://www.mydomain.com, mydomain2.com, or mydomain3.com from the LAN, it times out, and does not access the webserver. Accessing any of these domain names outside my LAN works fine. Checking Apache's log, it appears that, instead of accessing www.mydomain.com, it is trying to access Apache's default webpage, which isn't configured. I also have a number of smaller web devices, such as IP cameras, and these all work fine. Also, this was a working configuration with pfsense.

Any ideas?


This thread was automatically locked due to age.
  • instead of NAT rules use Request routing in DNS Service
    you are doing a loop in that WAN
  • Thanks for the response. It looks like Request Routing is supposed to work with my own DNS server, but I don't run one. I've tried using Static Entries, but there doesn't seem to be a way to use wildcards (*.mydomain.com), and adding and removing dozens of domains, and every possible variation, sounds like a job I just don't want. Also, adding static entries for whatever reason breaks accessing my email server locally.
  • RChadwick: Please try making the Full Nat rule position #1.  

    Rules are processed from top down, and you have created both rules correctly, but I believe the problem is that the first NAT rule is being hit when you need this traffic to hit the Full Nat when it's coming from inside the network.
  • Your request is hitting the DNAT (not the full nat) rule in the UTM and is being sent to your web server, but when your web server responds back to the internal client, the source IP address doesn't match the IP that the client is trying to talk to, so the client ignores the packet.  Assuming I'm right about what your problem is, but I'd bet money I am.
  • Thanks for the response. I made the Full NAT rule #1, but the result was the same.
  • Try activating the Automatic Firewall Rule option for that Full NAT rule? hmm...
  • I tried that as well, but it didn't work.
  • But you can confirm that the traffic is being redirected to your Apache web server because you can see in the logs it's requesting the root directly which isn't configured?  Are you sure that you see these log messages being generated every time you request the site?

    If so, this would indicate that the DNAT rule is working correctly as far as I can tell, it's forwarding the traffic to your internal web server.  Perhaps you should consider WAF after all?
  • Yes, I carefully checked the logs while trying to access a website. That's how I knew it was trying to access the default directory. It definitely reaches the server.
  • As for WAF, I've heard of lots of nightmares of weird issues and incompatibilities. As a test, I tried configuring it with a webcam, and couldn't get it to work. I figured it would be a good idea to try it out sometime, but thought it would be good to start with a working configuration.