Answer the question
In order to leave comments, you need to log in
How to properly configure Nginx and Glassfish?
Hello!
I deployed its url -> localhost:8080/app on Glassfish war and configured Nginx as follows:
server {
listen 80;
server_name domain1.info www.domain1.info;
rewrite ^/(.*)$ /app/$1;
location / {
proxy_pass http://localhost:8080;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~* \.(jpg|png|gif|jpeg|css|js|doc|pdf|xls|docx|xlsx|odt|odc|ico)$ {
root /home/servers/glassfish4/glassfish/domains/domain1/applications/app;
add_header Cache-Control public;
expires 4w;
}
}
Answer the question
In order to leave comments, you need to log in
What does the browser write to the console?
What does Nginx write to the logs?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question