Answer the question
In order to leave comments, you need to log in
nginx reverse proxy. How to raise a 4th level domain?
Hello!
There is a domain - itmust.ru
A third-level domain is created on it - test.itmust.ru
There is a server with proxmox, and one external ip address.
The task is to set up several 4th-level domains for testing with a redirect to proxmox host virtual machines (via http), for example:
Site1.test.itmust.ru
>> 192.168.89.171
Site2.test.itmust.ru >> 192.168.89.172
they were accessible from outside.
For the test, I installed a clean debian host, set up nginx on it, sort of like, set up a reverse proxy.
But it doesn't work, not site1.test.itmust.ru, not site2......
What's wrong?
Here is the nginx config:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
server{
listen 80;
server_name site2.test.itmust.ru;
location / {
proxy_pass http://192.168.89.172:80;
#proxy_set_header Host $http_host;
}
}
server{
listen 80;
server_name site1.test.itmust.ru;
location / {
proxy_pass http://192.168.89.171:80;
#proxy_set_header Host $http_host;
}
}
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question