Hide Nginx port

  • Posted on March 31, 2014
  • rav_bayAsked by rav_bay


I was wondering how to hide the port from my application. Currently, I’m accessing my application via where is the IP and yyyy is the port. I’m wondering how would you hide the port?

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.