Nginx将所有请求转发给index.php for framework。我想在nginx后面使用glassfish,但它不起作用。我认为代理响应不正确。我无法联系到glassfish管理控制台。
server {
listen 80;
listen [::]:80;
server_name ex.co;
return 302 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
include snippets/self-signed.conf;
include snippets/ssl-params.conf;
root /ex;
index index.php;
server_name ex.co;
location / {
rewrite ^ /index.php?q=$uri last;
}
location /gfadmin {
proxy_pass http://localhost:4848/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}