【发布时间】:2022-10-01 09:45:12
【问题描述】:
我在我的 azure Web 应用程序上收到了 404 Not Found nginx/1.14.2。
我正在使用连接到 azure MySQL 数据库的 azure Web 应用服务。
我找不到导致我的 API 路由响应为 404 错误的问题。
我检查了大多数答案,但我并没有真正明白,因为我是 azure 服务器配置的新手。 我使用 ssh 访问我的文件,但我不知道如何解决这样的问题......
这些是我的文件,如下所示: .htaccess 在公共场合是:
Options -Indexes
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
<Files .env>
Order allow,deny
Deny from all
</Files>
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
默认在/etc/nginx/sites-enabled
server {
#proxy_cache cache;
#proxy_cache_valid 200 1s;
listen 8080;
listen [::]:8080;
root /home/site/wwwroot/public;
index index.php index.html index.htm;
server_name example.com www.example.com;
location / {
index index.php index.html index.htm hostingstart.html;
}
location /snow/api {
root /var/www/html/snow/pubic;
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/;
}
# Disable .git directory
#
location ~ /\\.git {
deny all;
access_log off;
log_not_found off;
}
# Add locations of phpmyadmin here.
#
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 $document_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;
}
} ```
What am I missing?
-
我在 laravel azure web app 上有同样的问题。你找到解决办法了吗?
-
@nelsonym 不幸的是没有