【问题标题】:Geoserver NGINX configuration地理服务器 NGINX 配置
【发布时间】:2019-10-31 10:56:48
【问题描述】:

我是 Nginx 和 EC2 的新手,并尝试添加一些简单的身份验证,如下所示。这是一个单页应用程序,我想保护对页面的访问,但不保护磁贴服务器。没有身份验证一切正常。使用下面的身份验证,我会收到一条错误消息;

http://map.domain.org.uk is requesting your username and password. The site says: “GeoServer Realm”

我认为这是因为我已经为任何位置设置了身份验证,并且瓷砖位于其下方。我将如何设置为只要求对着陆页进行身份验证?

server {
    listen 80;
    listen [::]:80;

    root /var/www/domain.org.uk/public_html;

    index index.html;

    server_name domain.org.uk www.domain.org.uk map.domain.org.uk;

    access_log /var/log/nginx/domain.org.uk.access.log;
    error_log /var/log/nginx/domain.org.uk.error.log;

  # auth_basic "Server level Password required to proceed";
   # auth_basic_user_file /etc/nginx/conf.d/.htpasswd;

    location /geoserver/gwc/service/wmts {
      auth_basic off;
#also tested without auth_basic off;
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://localhost:8080/geoserver/gwc/service/wmts;
    }


    location / {
        try_files $uri $uri/ =404;
    auth_basic "Location level Password required to proceed";
   auth_basic_user_file /etc/nginx/conf.d/.htpasswd;
    }

}



【问题讨论】:

    标签: amazon-ec2 geoserver nginx-location nginx-config


    【解决方案1】:

    尝试运行http://localhost:8080/geoserver/wms?request=GetCapabilities

    另外,我认为This 在这种情况下对你很有用。

    这使用curl 实用程序发出HTTP 请求以测试身份验证。在继续之前安装 curl。

    另外,请检查 Linode 上的 /etc/nginx/sites-available/example.com Here

    例子

    upstream appcluster{ server linode.example.com:8801; server linode.example.com:8802 weight=1; }

    【讨论】:

    • 谢谢,但作为 OP,我知道请求没有身份验证就可以,所以这不是错误,这是我需要了解的 nginx 地理服务器的配置设置
    猜你喜欢
    • 2017-05-12
    • 1970-01-01
    • 2014-08-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-24
    • 2013-10-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多