0

I am new to nginx configurations. NGINX is redirecting all my requests to the home page and i do have an admin area placed in the /app folder in the root. My configuration is below. What am I doing wrong?

server
{
   listen 443 default_server ssl;
   listen [::]:443 ssl http2;
   server_name xxxxxxx.io www.xxxxxxx.io;
   ssl_certificate /etc/letsencrypt/live/xxxxxxx.io/fullchain.pem; # managed by Certbot
   ssl_certificate_key /etc/letsencrypt/live/xxxxxxx.io/privkey.pem; # managed by Certbot
   location /
   {
      root /home/ubuntu/xxxxxxx-ui/_work/xxxxxxxWebV1/xxxxxxxWebV1/build/web/;
      index index.html index.php;
      # try_files $uri /index.html index.php;
   }

    error_log /var/log/nginx/xxxxxxx.log;
    access_log /var/log/nginx/xxxxxxx.log;
}



server
{

    listen  80;
    server_name xxxxxxx.io www.xxxxxxx.io;
    return 301 https://xxxxxxx.io$request_uri;
    charset utf-8;
    root  /home/ubuntu/xxxxxxx-ui/_work/xxxxxxxWebV1/xxxxxxxWebV1/build/web/;
    index  index.html index.htm index.php;
    # Always serve index.html for any request
    location /
    {
        root /home/ubuntu/xxxxxxx-ui/_work/xxxxxxxWebV1/xxxxxxxWebV1/build/web/;
        # try_files $uri = index.html index.php;
    }
    return 301 https://xxxxxxx.io$request_uri; # managed by Certbot
    error_log  /var/log/nginx/vue-app-error.log;
    access_log /var/log/nginx/vue-app-access.log;
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.