apache - Cannot access all web servers from outside network -


i have 2 apache webservers, each running on separate raspberry pi. pi runs website 1, , pi b runs website 2. pi set dns server (and has pi b's information in /etc/hosts), , router has ports 80 , 443 forwarded it. while on local network works great, can access both websites. off network can access website 1. when try access website 2 default apache page pi a. thoughts?

you can configure nginx on frontend similar virtual host config:

server {     listen 443;     server_name _;     ssl on;     ssl_certificate         /srv/nginx/file.crt;     ssl_certificate_key     /srv/nginx/file.key;  location /site1 {     proxy_set_header host $host;     proxy_set_header x-forwarded-proto $scheme;     proxy_set_header x-real-ip $remote_addr;     proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;     proxy_pass https://127.0.0.1:8443;     proxy_http_version 1.1;     proxy_set_header upgrade $http_upgrade;     proxy_set_header connection "upgrade"; }  location /site2 {     proxy_set_header host $host;     proxy_set_header x-forwarded-proto $scheme;     proxy_set_header x-real-ip $remote_addr;     proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;     proxy_pass https://192.168.0.20:8443;     proxy_http_version 1.1;     proxy_set_header upgrade $http_upgrade;     proxy_set_header connection "upgrade"; }     access_log  /var/log/nginx/access.log;     error_log   /var/log/nginx/error.log; } 

nginx installation simple:

yum install nginx service nginx start 

also need edit apache ports default 8080 or 8443 example.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -