我尝试使用Nginx设置类似"Apache Alias"的位置,但我无法在此文件夹中处理PHP脚本.
这是我的文件夹结构(适用于Dev环境):
/var/www
+- dev/public/ <-- This is my normal Web root : "/"
| +- assets/
| | +- app.css
| | +- app.js
| |
| +- index.php
| +- favicon.png
|
+- cut/public/ <-- This must like an "Apache Alias" : "/cut"
+- assets/
| +- app.css
| +- app.js
|
+- index.php
+- other_other_file.php (why not)
Run Code Online (Sandbox Code Playgroud)
我尝试了不同的解决方案,但没有一个能正常工作.
这是我最好的Nginx配置:
server {
listen 80;
server_name _;
root /var/www/dev/public/;
index index.php index.html;
autoindex on;
# Logs
rewrite_log on; …Run Code Online (Sandbox Code Playgroud)