Welcome! Log In Create A New Profile

Advanced

Is an IP address valid for server_name?

Posted by rayj00 
Is an IP address valid for server_name?
January 04, 2018 09:46AM
So I will be using nginx as a reverse proxy. I do not have a domain name for my server yet. I am in development.

Can I use the IP address such as the following in /etc/nginx/sites-available/default:

server {
listen 80;

server_name 1.2.3.4; //Obvious fake IP.

location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}

Thanks in advance for your reply!

Ray
Re: Is an IP address valid for server_name?
January 04, 2018 01:56PM
Sure you can.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Is an IP address valid for server_name?
January 04, 2018 02:58PM
Thanks you sir. The answer I was hoping for.

Ray
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 124
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready