title: Laravel 403 Forbidden nginx/1.14.0 (Ubuntu) in Nginx Digital Ocean
body: <p>I deployed my Laravel-5.8 project to DigitalOcean and it works fine as:</p>
  
  <blockquote>
    <p><a href="http://laravelproject.net" rel="nofollow noreferrer">http://laravelproject.net</a></p>
  </blockquote>
  
  <p>But since I am using Azure AD and Socialite. Azure AD does not allow http but https</p>
  
  <p>/etc/nginx/sites-available/default</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>server {
  listen 80 default_server;
  listen [::]:80 default_server;
  
  # SSL configuration
  #
  # listen 443 ssl default_server;
  # listen [::]:443 ssl default_server;
  #
  # Note: You should disable gzip for SSL traffic.
  # See: https://bugs.debian.org/773332
  #
  # Read up on ssl_ciphers to ensure a secure configuration.
  # See: https://bugs.debian.org/765782
  #
  # Self signed certs generated by the ssl-cert package
  # Don't use them in a production server!
  #
  # include snippets/snakeoil.conf;
  
  root /var/www/html/laravelproject;
  
  # Add index.php to the list if you are using PHP
      # index index.php index.html index.htm;
  # index index.php index.html index.htm index.nginx-debian.html;
  
  server_name laravelproject.net;
  
  location / {
   # First attempt to serve request as file, then
   # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ /index.php$is_args$args;
   # try_files $uri $uri/ =404;
  }
  
  # pass PHP scripts to FastCGI server
  #
  location ~ \.php$ {
   include snippets/fastcgi-php.conf;
  #
  # # With php-fpm (or other unix sockets):
   fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
  # # With php-cgi (or other tcp sockets):
  # fastcgi_pass 127.0.0.1:9000;
  }
  
  # deny access to .htaccess files, if Apache's document root
  # concurs with nginx's one
  #
  location ~ /\.ht {
   deny all;
  }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>I also have:</p>
  
  <p>/etc/nginx/sites-available/default</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>server {
      listen 80;
      listen [::]:80;
  
      server_name laravelproject.net;
      return 301 https://$server_name$request_uri;
  }
  
  server {
      listen 443 ssl http2;
      listen [::]:443 ssl http2;
      server_name laravelproject.net;
      root /var/www/html/peopleedge;
  
      ssl_certificate /etc/letsencrypt/live/laravelproject.net/fullchain.pem;
   ssl_certificate_key /etc/letsencrypt/live/laravelproject.net/privkey.pem;
      
      ssl_protocols TLSv1.2;
   ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
   ssl_prefer_server_ciphers on;
  
   add_header X-Frame-Options "SAMEORIGIN";
   add_header X-XSS-Protection "1; mode=block";
   add_header X-Content-Type-Options "nosniff";
  
   index index.php index.html index.htm index.nginx-debian.html;
  
      charset utf-8;
  
      location / {
              try_files $uri $uri/ /index.php?$query_string;
      }
  
      location ~ \.php$ {
          include snippets/fastcgi-php.conf;
          fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
      }
  
      location ~ /\.ht {
              deny all;
      }
  
      location ~ /.well-known {
              allow all;
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I tried to run the project I got this error:</p>
  
  <blockquote>
    <p>Laravel 403 Forbidden nginx/1.14.0 (Ubuntu)</p>
  </blockquote>
  
  <p>How do I resolve it please?</p>
  
  <p>Thank you.</p>