Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29549

Geoserver NGINX configuration

$
0
0

I'm new to Nginx and EC2 and trying to add some simple authentication as below. It's a one page app and i want to secure the access to the page but not the tile server. With no authentication all works well. With authentication as the below I get back an error saying;

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

I think this is because I've set authentication for any location and the tiles sit under that. How would I set up to just require authentication for the equivalent of a landing page?

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;
    }

}




Viewing all articles
Browse latest Browse all 29549

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>