• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Add domain directly to apache

hobbyist_MUC

New Pleskian
Hello Forum,
I have been using plesk for a few years now, generally I am happy, but sometime it drives me crazy. Just like right now.
I have 8 domains connected to plesk, but since I wanted to try ASP.net development I tried to deploy a asp.net application to the server, with its own domain.
The asp.net application is running nice in a service and is listening to localhost:5500/5501.
So right now I have pleskdomain1.com pleskdomain2.com .... and aspdomain1.com.
It is really hard for me to understand how to configure apache so the incoming requests for aspdomain1.com are directly forwarded to localhost:5500.
Which apache conf do I have to edit so it works as intended.

Plesk Version: Plesk Obsidian 18.0.36, last updated on July 1, 2021 04:43 AM
OS: Ubuntu 18.04.5 LTS

ASP.net Application listening to http://localhost:5500 & https://localhost:5501

Any help is appreciated!
 
Thanks @IgorG
I thought I needed to add the domain somewhere else (for example sites-available dir) i did not know you could just add it to Additional directives.
I am having another problem now. "Internal Error 500".
'proxy_http' is enabled (also 'proxy'). My Additional Apache directives looks like this:

Code:
ProxyPass / https://localhost:5501/
ProxyPassReverse / https://localhost:5501/

(If asp.net application is not running, i am getting error 503)
 
I have only proxied with nginx yet, but I'd guess if you put it into additional directives of an existing domain that there is already a directive for /, which collides with yours. Try a /subdir.
 
I figured it out.
asp.net redirects http request to https. (http://localhost:5500/->https://localhost:5501/). But because of me not adding any valid ssl certificate to my asp.net application. It used an untrusted certificate. I just had to comment out one line in my Startup class, so it would accept http request (ssl certificate not needed for proxyied requests).
So basically what happend, Apache would try to proxy to https://localhost, which has no valid ssl vertificate, this would throw the 500 internal error code.
My Additional Apache directives look like this now:

Code:
ProxyPass / http://localhost:5500/
ProxyPassReverse / http://localhost:5500/
 
Back
Top