首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Geoserver NGINX组态

Geoserver NGINX组态
EN

Stack Overflow用户
提问于 2019-10-31 10:56:48
回答 1查看 1.3K关注 0票数 2

我是Nginx和EC2的新手,我试图添加一些简单的身份验证,如下所示。这是一个只有一个页面的应用程序,我想保护对该页面的访问,但不希望保护该服务器。在没有身份验证的情况下,所有的功能都很好。使用下面的身份验证,我得到了一个错误说明;

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

我认为这是因为我已经为任何位置设置了身份验证,而瓷砖就位于它下面。我将如何设置,以只要求认证相当于一个登陆页?

代码语言:javascript
复制
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;
    }

}
EN

回答 1

Stack Overflow用户

发布于 2019-11-09 09:49:20

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

而且,在这种情况下,我认为对您是有用的。

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

另外,请检查/etc/nginx/sites-available/example.com 这里 on Linode

示例

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58641858

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档