Hide Nginx port

March 31, 2014 1.6k views
Hi, I was wondering how to hide the port from my application. Currently, I'm accessing my application via http://xxx.xxx.xxx:yyyy where xxx.xxx.xxx is the IP and yyyy is the port. I'm wondering how would you hide the port?
3 Answers
You do not 'hide a port'. You use standard ports, in this case, you want port 80.
thanks for that.

BTW, I just did that and my app is still not displaying properly.
I'm getting the page

"Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required."

I'm using dokku so I'm putting my nginx.conf inside my /home/dokku/app_name

my nginx.conf is

server {
listen 80;

server_name app_name;
location / {
# enable gzip compression
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript text/xml text/css;
gzip_vary on;
# end gzip configuration


is there anything wrong with my conf?
or should I place it somewhere else?
nginx.conf should stay in the respective location by default, that's where it stays. Change the document root to where you want the files to be. That message shows that you have set up nginx properly, but it's using the default nginx welcome page. Use root in your server block to define this.

root /home/directory/anotherdirectory;
Have another answer? Share your knowledge.