By stylohunk
What’s the proper way to configure Nginx to allow IP:PORT requests like this:
//App is deployed on 8086
http://X.X.X.X:8086/?a=xxx&b=yyy&c=zzz ((http requests))
over TCP or UDP
//Another app is deployed on 5050
http://X.X.X.X:5050/postRequest (http requests)
over TCP or UDP
My nginx.conf
server {
include /etc/nginx/conf.d/*.conf;
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /home/ubuntu/var/www/html;
index index.html index.htm default.html;
access_log /etc/nginx/logs/access.log mycustomformat;
My PM2 have multiple applications deployed I want to access them by <IP>:<PORT>/request
Thanks
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!
Hi there,
If you need to access your applications on IP:PORT, there is no need to use Nginx. For example, you could start multiple Docker containers on different ports, and access them directly on those ports.
Ngnix would come in handy if you want to “hide” the ports, in this case you could setup Nginx as a reverse proxy:
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.