1

我有以下示例 url 格式

http://test.example.com:3000/samp/value?AP=API&SE=AU

价值是动态的

下面是我的 ngnix 配置文件

#pid        logs/nginx.pid;
events {
worker_connections  1024;
}
http {
# HTTPS server                                                                            

upstream node_entry {
server test.example.com:3000
}                                                                               
server {
listen       443;   
ssl                  on;
ssl_certificate      /etc/ssl/certs/myssl.crt;
ssl_certificate_key  /etc/ssl/private/myssl.key;
server_name  domainname;
location / {
    #root   html;
    #index  index.html index.htm;
    return 503;
}
location /samp {
    proxy_pass   node_entry;
}
}

}

当我点击 http://test.example.com/samp/value?AP=API&SE=AU时,我收到一条错误消息:无法获取

/samp/value?AP=API&SE=AU。我在这里做错了什么。

对此的任何帮助都会非常有帮助

谢谢,

4

1 回答 1

1

改变

proxy_pass   node_entry;

proxy_pass   https://node_entry;

对于配置测试,您可以运行nginx -t并获得类似

nginx: the configuration file conf/nginx.conf syntax is ok
nginx: configuration file conf/nginx.conf test is successful

或者

nginx: [emerg] invalid URL prefix in conf/nginx.conf:26
nginx: configuration file conf/nginx.conf test failed
于 2013-06-03T17:08:27.320 回答