Question

Hide Nginx port

  • Posted March 31, 2014

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?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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. <br> <br>root /home/directory/anotherdirectory;

thanks for that. <br> <br>BTW, I just did that and my app is still not displaying properly. <br>I’m getting the page <br> <br>“Welcome to nginx! <br> <br>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.” <br> <br>I’m using dokku so I’m putting my nginx.conf inside my /home/dokku/app_name <br> <br>my nginx.conf is <br> <br> <br>server { <br> listen 80; <br> <br> server_name app_name; <br> location / { <br> # enable gzip compression <br> gzip on; <br> gzip_min_length 1100; <br> gzip_buffers 4 32k; <br> gzip_types text/plain application/x-javascript text/xml text/css; <br> gzip_vary on; <br> # end gzip configuration <br> <br> } <br>} <br> <br>is there anything wrong with my conf? <br>or should I place it somewhere else?

You do not ‘hide a port’. You use standard ports, in this case, you want port 80.