Custom nginx config file
Hello!
I'm trying to make a reverse proxy with Nginx for a subdomain.
This is the config file:
The domain from the server_name is changed for privacy reasons.
When I try to access the webpage it shows me this:
I've put the config file in /etc/nginx/conf.d. The file name is api.mydomain.com.conf
-
Hey there! By default, cPanel will handle all of this for you if you are using our Nginx tools at NGINX with Reverse Proxy | cPanel & WHM Documentation. We create a configuration that proxies 80 to port 81 and 443 to 444, so this would cover all subdomains created with cPanel. Can you let me know what is custom about this subdomain that would require unique routing? We don't recommend trying to serve content out of the /var/www/ directory. 0 -
Thanks for the additional details. I believe you're trying to do something like this: username with the domains and subdomains configuration in separate files.
0 -
i'm glad we're making some progress! In the example, they have a username directory: /etc/apache2/conf.d/userdata/std/2_4/$username/$domain.tld/tomcatproxypass.conf: so you could create additional configuration files under /etc/apache2/conf.d/userdata/std/2_4/$username/ to perform that work with each subdomain. 0 -
i'm glad we're making some progress! In the example, they have a username directory: /etc/apache2/conf.d/userdata/std/2_4/$username/$domain.tld/tomcatproxypass.conf: so you could create additional configuration files under /etc/apache2/conf.d/userdata/std/2_4/$username/ to perform that work with each subdomain.
Ok, thank you very much!0 -
You're welcome! 0
Please sign in to leave a comment.
Comments
7 comments