我使用反向代理在Nginx建立了Laravel项目。
这是我对这个项目的反向代理。
server {
listen 8090;
listen [::]:8090;
access_log /var/log/nginx/localhost.laravel-access.log;
error_log /var/log/nginx/locahost.laravel-error.log error;
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}
location ^~ / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_pass http://XXX.XX.X.X:8082/;
}
}目前,安装程序正在侦听端口8090。所以当我访问这个项目时,它是打开的。
XXX.XXX.X.XXX:8090/登录
这里的问题是,在向我的项目输入登录凭据后,端口8090丢失,并且我被重定向到
XXX.XXX.X.XXX
只有IP地址。
谢谢
发布于 2019-12-02 05:02:18
如果可以在env文件中设置APP_URL
APP_URL=http://localhost:8090或者在config/app.php中设置url
'url' => env('APP_URL', 'http://localhost:8090'),然后
php artisan config:clearhttps://stackoverflow.com/questions/59131833
复制相似问题