Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74846

Nginx returns 401 for subdirectory index.html

$
0
0

I have a website and every time when I try to access the page in a subfolder like 'myDomain.com/privacy-policy', nginx returns me a '401 Authorization Required'. The website has the following folder structure:

-myDomain.com/
  -index.html
  -images/
    -(images..)
  -legal-disclosure/
    -index.html
    -css/
      -(css files..)
  -privacy-policy/
    -index.html
    -css/
      -(css files..)
  -template/
    -templates.min.css

The corresponding nginx configuration:

server {
    listen 80;
    server_name myDomain.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl;
    server_name myDomain.com;

    ssl_certificate /root/ssl-certs/myDomain.com_ssl_certificate.cer;
    ssl_certificate_key /root/ssl-certs/_.myDomain.com_private_key.key;

    location / {
      root /var/www/html/myDomain.com;
      index index.html;
    }

    location /privacy-policy {
      root /var/www/html/myDomain.com/privacy-policy;
      index index.html;
     }

    location /legal-disclosure {
      root /var/www/html/myDomain.com/legal-disclosure;
      index index.html;
     }
}

Does anyone knows why?


Viewing all articles
Browse latest Browse all 74846

Latest Images

Trending Articles



Latest Images

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