aahmyu 9 Posted May 1, 2019 Posted May 1, 2019 Hello, Thanks to thee guides here i managed to setup a reverse proxy server using nginx for my servers. I have a couple of questions though: 1- When i access emby.mydomain.com locally does the request go through the internet? i did a ping test and when pinging my domain locally i getting the same ping as i ping emby local address. But im a bit noob when it comes to this so im just double checking here. 2- This is why im actually posting here. when i access emby from my domain locally the logs display my external ip address which is not wrong because my domain resolves to my external ip, my question is, is it possible to get the client real ip address like 192.168.1.55 when i access locally instead of my external ip? Thanks
Luke 40114 Posted May 1, 2019 Posted May 1, 2019 I would check the server activity viewer in the server dashboard, where it shows the ip address. What does it say there?
aahmyu 9 Posted May 1, 2019 Author Posted May 1, 2019 When I'm at home it displays the router external ip no matter what device I use. And remotely it displays the ip I'm connecting from. Maybe what I'm asking is not possible? I'm trying to find a way to display the correct internal ip when I'm at home instead of displaying router external ip all the time
darkassassin07 620 Posted May 2, 2019 Posted May 2, 2019 (edited) The way I achieved this was by setting the host name of the device my nginx server is running on to be the same as my domain name. In my routers configuration, devices that have been given a dhcp reservation (for a static ip address) also have the option to specify a hostname. Seprate from that there is also a box for custom dnsmasq parameters that I have hostname/ip address combinations in. Because of this, devices that try my domain name while on lan are given the lan ip of the nginx server instead of my wan ip. Im sure there are other ways as well, but im a bit of a noob myself Hope that helps a bit /edit for this method to work you have to be using the same port for lan/wan access. Example: Mydomain.com:443 on wan [nginx lan ip]:443 on lan These two port numbers should match regardless of which port you chose Edited May 2, 2019 by darkassassin07
pir8radio 1305 Posted May 3, 2019 Posted May 3, 2019 (edited) Hello, Thanks to thee guides here i managed to setup a reverse proxy server using nginx for my servers. I have a couple of questions though: 1- When i access emby.mydomain.com locally does the request go through the internet? i did a ping test and when pinging my domain locally i getting the same ping as i ping emby local address. But im a bit noob when it comes to this so im just double checking here. 2- This is why im actually posting here. when i access emby from my domain locally the logs display my external ip address which is not wrong because my domain resolves to my external ip, my question is, is it possible to get the client real ip address like 192.168.1.55 when i access locally instead of my external ip? Thanks Yea you shouldn't use the domain name from within your house, what it does is looks up the domain name on the net, gets the wan ip, and ends up using a "loopback interface" within your router. I mean it will work but its not ideal.. I would just use the server computer name similar to what dark assassin said above. Edited May 3, 2019 by pir8radio
aahmyu 9 Posted May 3, 2019 Author Posted May 3, 2019 Thanks for your replies. I will take a look again today. The thing is my router is basic provider router and doesn't have advanced options.
darkassassin07 620 Posted May 3, 2019 Posted May 3, 2019 (edited) If you cant do it through the router itself, you should also have the option on most operating systems to set a hostname for that device. Just google 'set [os name] hostname'. ('set windows 10 hostname' for example). You will most likely have to restart the network connection on that device after changes are made (re-plugin the lan cable, or re-connect to the wifi, or just restart the whole device) I don't have much experience with that myself, so sry I can't be more help. Once you have your hostname set, you can use the dev tools in chrome to see what ip address your given when you try to connect to your domain name. If all is setup correctly, devices outside your lan should be given your wan ip address by your dns provider and devices on your lan should get the lan ip of your nginx server directly from your router. Edited May 3, 2019 by darkassassin07
aahmyu 9 Posted May 3, 2019 Author Posted May 3, 2019 Thanks for your reply. I found a solution and fixed my issue. I fixed it by running a local dns server on my server and set my router to assign my dns server address instead of my provider's address, also set nginx resolver to my dns server address. Now everything works fine and i can see the correct ip address in emby dashboard.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now