• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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