-1

I deployed an application on Azure App Services, but for some reason it only gives error 403 Nginx 1.24.0, I went to the access restrictions, I put 0.0.0.0/0 to allow everything, but the error still persists, the application was made in php 8.1 with laravel, and this error persists and I already tried to do everything, I need help please

[](https://i.stack.imgur.com/YML9W.png)

I tried to work with nginx (it didn't work out very well due to lack of knowledge, I tried to create a load balancer, but I realized that wasn't it because this project has already been deployed before without any of that and it went normally, I paid my debt with Azure and my website didn't come back online, and now it's giving this

AjayKumar
  • 2,812
  • 1
  • 9
  • 28
  • Please share more details. Is nginx itself throwing the error, or your application? What have you tried to resolve the problem? Where are you stuck? – Nico Haase Aug 03 '23 at 12:20

1 Answers1

0

Based on my understanding, when viewing your PHP Laravel WebApp on NGINX it shows 403 error.

Laravel serves content out of it's /public directory. By default, on App Service Linux use its site root as /home/site/wwwroot.

PHP 8.x uses NGINX as a default Web Server (for blessed images), you will need to use a custom startup script to serve content out of /public

Kindly take a look at the steps on enabling and using a custom startup script that is targeting NGINX as the Web Server can be found here - NGINX Rewrite Rules for Azure App Service Linux PHP 8.x

By default, if no "Startup File" is specified, the default startup command will be service nginx start.

This default.conf has the line: root /home/site/wwwroot

You may change it to: root /home/site/wwwroot/public

Additionally,

You may enable App Service Logs to see the startup command the customer is specifying / to fetch more details.

Checkout the article : Laravel Deployment on App Service Linux

AjayKumar
  • 2,812
  • 1
  • 9
  • 28