I'm trying to redirect :
AAA.myhost.com --> http://127.0.0.1:888/AAA
BBB.myhost.com --> http://127.0.0.1:888/BBB
first : is it possible to do this ? second : I know how to redirect to internal app ... my nginx config :
worker_processes 1;
user root root;
# 'user nobody nobody;' for systems with 'nobody' as a group instead
pid /run/nginx.pid;
error_log /tmp/nginx.error.log;
events {
worker_connections 1024; # increase if you have lots of clients
accept_mutex off; # set to 'on' if nginx worker_processes > 1
}
http {
include mime.types;
upstream wordpress {
server 127.0.0.1:888 fail_timeout=0;
}
default_type application/octet-stream;
access_log /tmp/nginx.access.log combined;
sendfile on;
server {
listen 80 default_server;
return 444;
}
server {
listen 80 deferred;
client_max_body_size 1M;
server_name www.host.com;
keepalive_timeout 5;
location / {
rewrite /wordpress redirect;
try_files $uri @proxy_to_wordpress;
}
location @proxy_to_wordpress {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://wordpress;
}
error_page 500 502 503 504 /500.html;
}
}