Last active
January 17, 2024 08:06
-
-
Save schakko/8076888f98fed2b1f4cc2448d44a3057 to your computer and use it in GitHub Desktop.
Adjusted nginx.conf to make Laravel 9 and Laravel 10 apps with PHP 8.0, 8.1 and 8.2 features runnable on Azure App Service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
# adjusted nginx.conf to make Laravel 9 and Laravel 10 apps with PHP 8.0, 8.1 and 8.2 features runnable on Azure App Service | |
# @see https://laravel.com/docs/10.x/deployment | |
# @see https://laravel.com/docs/9.x/deployment | |
listen 8080; | |
listen [::]:8080; | |
root /home/site/wwwroot/public; | |
index index.php; | |
server_name example.com www.example.com; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
# redirect server error pages to the static page /50x.html | |
# | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /html/; | |
} | |
location ~ [^/]\.php(/|$) { | |
fastcgi_split_path_info ^(.+?\.php)(|/.*)$; | |
fastcgi_pass 127.0.0.1:9000; | |
include fastcgi_params; | |
fastcgi_param HTTP_PROXY ""; | |
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
fastcgi_param QUERY_STRING $query_string; | |
fastcgi_intercept_errors on; | |
fastcgi_connect_timeout 300; | |
fastcgi_send_timeout 3600; | |
fastcgi_read_timeout 3600; | |
fastcgi_buffer_size 128k; | |
fastcgi_buffers 4 256k; | |
fastcgi_busy_buffers_size 256k; | |
fastcgi_temp_file_write_size 256k; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems to me that it might be caused by your startup script which was modified on Windows machine with CRLF. So, the Azure PHP App Service could not recognize that script. Could you try to convert it to LF with Notepad++ or VS Code?