我需要加载外部网站到nginx子文件夹,我试了很多,仍然不工作,这是我现在有:
ngixn.coonfig
worker_processes 2;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {}
http {
upstream keepalive-upstream {
server google.com:443;
keepalive 64;
}
server {
listen 9091 ssl;
ssl_certificate /etc/ssl/nginx-selfsigned.crt;
ssl_certificate_key /etc/ssl/nginx-selfsigned.key;
location /looker {
proxy_pass https://keepalive-upstream;
proxy_http_version 1.1;
proxy_ssl_server_name on;
proxy_buffering off;
proxy_set_header Accept-Encoding "";
proxy_set_header Host google.com;
sub_filter "https://google.com/looker" "https://localhost:9091/looker/";
sub_filter_types *;
sub_filter_once off;
}
location / {
root /www;
}
}
}
字符串
从这里开始,我的目标只是将Google加载到https://localhost:9091/looker子文件夹中
但是当我运行的时候,我看到了谷歌的错误页面,错误是:
404. That’s an error.
The requested URL /looker was not found on this server. That’s all we know.
型
任何人都可以看看上面的nginx配置,并告诉我什么修复可以使它工作?
先谢了。
1条答案
按热度按时间uujelgoq1#
更新2023-12-23
字符串