We are aware of a potentially service impacting issue. Learn more

Deploying Applications with Non-Standard Ports Print


Deployment of a non-standard port application on a server using domain or sub-domain, such as example.com:9090 -> https://example.com, can be easily achieved using DirectAdmin interface.



1. Begin by adding the domain where the application will be hosted through the DirectAdmin interface, for instance, example.com. Ensure to enable the "Standalone Nginx" option for the specified domain.

kb26042024-nginx-001.png

2. Proceed to the Admin interface of the panel and locate the "Custom HTTPD Configurations" option. On the resulting page, locate the "nginx.conf proxy" link corresponding to the application domain.

kb26042024-nginx-002.png

3. Access the Domain Configuration page by clicking the link. Then, navigate to the "Customize" section.

kb26042024-nginx-003.png

4. In the "Customize" section, locate and select "CUSTOM3" from the available fields.

kb26042024-nginx-004.png

5. Insert the following configuration into the "CUSTOM3" field:


location /
{
proxy_buffering off;
proxy_pass http://127.0.0.1:9090;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header X-Client-IP $remote_addr;
proxy_set_header X-Accel-Internal /nginx_static_files;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

 Ensure to adjust the proxy_pass http://127.0.0.1:9090 section to match the interface and port where the application is running.

6. Once the modifications are made, save the changes.

« Back