简体   繁体   中英

Accessing locally hosted site through public ip

I have setup a django app on a apache server in a VM. The site is accessible when I use the apache server IP in the VM browser. It is also accessible from the host browser through it's local IP. But, I cannot access it through the public IP over the internet. I get a site can't be reached error I have set up port forwarding such that: 1. All router requests on port 80 are forwarded to local IP 2. All requests to local IP on port 80 are forwarded to the VM

I checked if my port is open on my public ip using http://www.yougetsignal.com/tools/open-ports/ It says that my port is closed. Same results with http://canyouseeme.org/

I am able to ping my public ip successfully. I have tried disabling all my firewalls but this has not helped. Please tell me if you need any code to be shared. Any help would be appreciated.

Edit: Extra information: It seems my router's WAN IP is different from my public IP. I can access the site through the WAN IP from the host browser but again, I am not able to access it over the internet.

You just need a public IP address or push your application to the hosting (like this for example https://gpdhost.com/offers/ ).

ToDo: learn DMZ, learn WAN-LAN packet forwarding process, learn TCP/IP routing, learn public and private IP addressing and learn NAT.

Description: http/https connection conversation (client-outside vs your-server): 1) client: in browser write: sharan-site/; 2) get IP by DNS name from public servers? But public servers don't know your ip:dns-name pair... => fail next example: 1) client: 192.168.1.1/ - where IP is your server 2) so where is it? => nowhere, it is private IP address! Fail...

Desc+: Port forwarding it is NAT feature. Your router must have public IP address, and you must setup DMZ like scheme in your local network: https://www.cisco.com/c/en/us/support/docs/ip/network-address-translation-nat/13772-12.html

Desc++: that sites check outside tcp/80 port on your router and PC, and it's open, no questions... But this no help for your task.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM