小编Mik*_*dov的帖子

如何修复 nginx 错误“参数数量无效”?

我尝试重定向到代理服务器 nginx。

        location /phpmyadmin {
        proxy_http_version 1.1;
        proxy_pass https://${PMA}:5000/;
        proxy_set_header Host      $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
Run Code Online (Sandbox Code Playgroud)

但我收到错误:

nginx: [emerg] invalid number of arguments in "proxy_set_header" directive in /etc/nginx/nginx.conf:26
Run Code Online (Sandbox Code Playgroud)

此清单中检查错误的完整代码,因为我真的找不到某些错误(${env} = 脚本中的正确更改

user root;
worker_processes auto;
pcre_jit on;

events {
    worker_connections 1024;
}

http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    keepalive_timeout 3000;
    sendfile on;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;
    server {
        listen 443 ssl;
        listen [::]:443 ssl;
        ssl_certificate /etc/ssl/nginx.crt;
        ssl_certificate_key /etc/ssl/nginx.key;
        root /home;
        index default.html /default.html;
        location /phpmyadmin {
            proxy_http_version 1.1;
            proxy_pass https://${PMA}:5000/; …
Run Code Online (Sandbox Code Playgroud)

reverse-proxy nginx docker docker-compose nginx-reverse-proxy

2
推荐指数
1
解决办法
5598
查看次数