我有后端服务器在http和https上运行一个网站。
server { listen front_IP:80; server_name dns_name; allow all; location / { proxy_pass http://backend_IP; proxy_set_header Host $host; }
和
server { listen front_IP:443; server_name dns_name; allow all; ssl on; ssl_trusted_certificate CA_file_Path; ssl_certificate Cert_file_path; ssl_certificate_key Key_file_path; location / { proxy_pass https://backend_IP; proxy_set_header Host $host; } }
都正常工作。
但是(对于ssl卸载)在https上进行监听并且对http进行proxy_pass(反之亦然)会导致客户端不完美地加载页面。 为了更准确,客户端不会加载任何主题,CSS或模板。
有些事情是这样的我的意思是:
server { listen front_IP:443; server_name dns_name; allow all; ssl on; ssl_trusted_certificate CA_file_Path; ssl_certificate Cert_file_path; ssl_certificate_key Key_file_path; location / { proxy_pass http://backend_IP; proxy_set_header Host $host; } }
我该怎么办?