@ Syrius: Danke das werde ich mir auch noch anschauen.
/etc/nginx/nginx.conf
Code:
user nginx;
worker_processes 2; # Set to number of CPU cores
pid /run/nginx.pid;
events {
worker_connections 1024;
}
http {
##
# Basic Settings
##
sendfile on;
keepalive_timeout 65;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# add into "server" section
server {
listen SERVER_IP_PROXY:80;
server_name www.domain1.com domain1.com;
location / {
proxy_buffering off;
proxy_pass http://BACKEND_SERVER_IP:80;
}
}
server {
listen SERVER_IP_PROXY:80;
server_name www.domain2.com domain2.com;
location / {
proxy_buffering off;
proxy_pass http://BACKEND_SERVER_IP:80;
}
}
##
# Virtual Host Configs
##
# include /etc/nginx/conf.d/*.conf;
# include /etc/nginx/sites-enabled/*;
}
Der Backend hört auf Port 80.
Wichtig ist auch das ich die IP des Besuchers im access.log am Backend erhalte.