docker代理中的nextjs通过apache2给出了502个代理错误



我有一个在docker中运行的nextjs应用程序。当我在本地运行相同的docker映像并转到localhost:3000时,一切都运行得很完美。

然后我将图像部署到服务器,我有apache2代理传递到网站,我得到一个损坏的登录页

我看到我收到了类似的错误

Request URL: http://example.com/_next/static/css/175964cd052c7c3f.css
Request Method: GET
Status Code: 502 Proxy Error

我的apache设置是这样的

<VirtualHost *:80>
ServerName example.com
ServerAlias  example.com
ProxyPreserveHost On
ProxyRequests Off
ProxyVia On
ProxyPass  /excluded !
ProxyPass / http://127.0.0.1:3000 connectiontimeout=6000 timeout=6000
ProxyPassReverse / http://127.0.0.1:3000
CustomLog /var/log/apache2/mydomain.access.log combined
ErrorLog /var/log/apache2/mydomain.error.log
</VirtualHost>

如有任何帮助,将不胜感激

感谢

<VirtualHost *:80>
ServerName www.myservername.com
ServerAlias myservername.com
ErrorLog /var/www/myapp/log/error.log
CustomLog /var/www/myapp/log/requests.log combined
ProxyRequests on
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</VirtualHost>

似乎有什么东西在冲突。当我把它剥离到上面时,它工作

最新更新