Azure Web App (Linux) Laravel 9 - Nginx only works when force /public/index.php

Fer Moreno 16 Reputation points
2023-06-29T19:35:39.0866667+00:00

Hi, my app was working just fine this morning, I did not deploy any changes but suddenly the server stopped using nginx conf properly, not only the index is not redirecting to public folder but also, I can only use my app if I force in URL to use /public/index.php otherwise received a not found error.

I did not make any changes, tried to restart, rebuild the nginx config and nothing, only if I force the URL.

Since nginx is loaded via startup script must be server related, right?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,934 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Abraham Garcia 5 Reputation points
    2023-06-30T18:17:20.2366667+00:00

    1

    I had the same issue a couple of hours ago. My laravel 10 application was working as expected and suddendly stopped working (I did not deploy a new version).

    I realized that nginx version changed to 1.24 so you can check this part.

    What worked for me was to have the same config file you have in /etc/nginx/sites-available in /etc/nginx/sites-enabled

    You could try copy this file like this:

    cp /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
    

    Considering default is the filename of your config you mentioned.

    Also you could make a symbolic link if you want

    ln -s sites-available/default sites-enabled/default
    

    You may have to remove sites-enabled/default before doing the link

    Then restart nginx

    service nginx restart
    

    I do not know if this is the best solution, but fixed the problem

    Hope this works for you

    1 person found this answer helpful.

  2. Fer Moreno 16 Reputation points
    2023-07-03T19:04:18.9066667+00:00

    The proper image/config is now working. Seems that has been restored, my app is functional on nginx again.

    Definitely was on the server side.

    Make sure to clear cache in case is not showing properly.

    Thanks to all that helped to amplify the issue, so it was attended.

    1 person found this answer helpful.

  3. Grmacjon-MSFT 19,151 Reputation points Moderator
    2023-07-07T03:06:47.85+00:00

    Hi @Fer Moreno , I wanted to share an update with you about this issue and tried responding to your email but it says your email "domain does not exist."

    This issue has been resolved by the product group so your application should be working now. please restart your application and let us know if come across any problems.

    -Grace


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.