Nastavení proxy
Portaro lze spustit za reverzním proxy (apache, nginx, haproxy), s těmito podmínkami:
- Proxy musí zachovat hlavičky:
Host
,X-Forwarded-For
,X-Forwarded-Host
a ideálněX-Forwarded-Proto
- Portaro musí mít vypnutý
OPAC.ForceHttps
Konfigurace šablony Apache virtualhost
<VirtualHost *>
ServerName katalog-halenkovice.napajedla.cz
#proxy
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPassReverseCookiePath / /
</VirtualHost>
Konfigurace šablony Nginx
# set max upload size
client_max_body_size 100M;
server {
listen 443;
server_name katalog.szu.cz;
ssl_certificate /etc/nginx/conf.d/certs/linux_cert+ca.pem;
ssl_certificate_key /etc/nginx/conf.d/certs/mimon_pk.pem;
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_pass http://10.10.11.16:8001;
}
}
server {
listen 443;
server_name katalogpers.szu.cz;
ssl_certificate /etc/nginx/conf.d/certs/linux_cert+ca.pem;
ssl_certificate_key /etc/nginx/conf.d/certs/mimon_pk.pem;
location / {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_pass http://10.10.11.16:8002;
}
}