Я хочу, чтобы мое ASP. NET основное приложение размещалось через Apache, чтобы порт 80
перенаправлялся на порт 5000
или 5001
для https. (мой локальный IP-адрес 192.168.1.250 для контекста в результатах)
Я пробовал следующие конфигурации с разными результатами:
- Прокси для
http://127.0.0.1:5000/
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5000/
ProxyPassReverse / http://127.0.0.1:5000/
ErrorLog /var/log/apache2/myapp.log
CustomLog /var/log/apache2/myapp.log common
</VirtualHost>
Перенаправит меня на порт 5001, но я получаю это в Chrome:
This site can’t be reached: 192.168.1.250 refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
- Прокси для
https://127.0.0.1:5001/
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / https://127.0.0.1:5001/
ProxyPassReverse / https://127.0.0.1:5001/
ErrorLog /var/log/apache2/myapp.log
CustomLog /var/log/apache2/myapp.log common
</VirtualHost>
Эта конфигурация дает мне 500 Internal Server Error
:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Apache/2.4.25 (Debian) Server at 192.168.1.250 Port 80
- Прокси для
http://127.0.0.1:5001/
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5001/
ProxyPassReverse / http://127.0.0.1:5001/
ErrorLog /var/log/apache2/myapp.log
CustomLog /var/log/apache2/myapp.log common
</VirtualHost>
Эта конфигурация дает мне 502 Proxy Error
:
Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request
Reason: Error reading from remote server
Apache/2.4.25 (Debian) Server at 192.168.1.250 Port 80
Есть идеи по конфигурации, которая могла бы работать?