It is now not nginx configuration problem but your application or Jetty configuration problem. Your application, running under Jetty still 'thinks' its URL is /myapp/ not /, you should change your application configuration to use right base URL.
Theoretically the server could rewrite the links when passing the application responses back to the clients (Apache with right module can do that, I am not sure about nginx), but that is a good idea only if you cannot fix the application or server you proxy-pass to.
I managed to configure a shared dedicated hosting on a single IP with nginx. Default HTTP and HTTPS serving a 404 for unknown domains incoming.
1 - Create a default zone
As nginx is loading vhosts in ascii order, you should create a 00-default
file/symbolic link into your /etc/nginx/sites-enabled
.
2 - Fill the default zone
Fill your 00-default
with default vhosts. Here is the zone i am using:
server {
server_name _;
listen 80 default_server;
return 404;
}
server {
listen 443 ssl;
server_name _;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;
return 404;
}
3 - Create self signed certif, test, and reload
You will need to create a self signed certificate into /etc/nginx/ssl/nginx.crt
.
Create a default self signed certificate:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt
Just a reminder:
- Test the nginx configuration before reloading/restarting :
nginx -t
- Reload a enjoy:
sudo service nginx reload
Hope it helps.
Best Answer
0, 1 and 2 are the values that the variable $geo takes when in use for that specific IP. Later in the documentation is't clearer
Then you can use it as you wish, ie (devil if used only as example)