Gerektiğinde sınırsız ___.framework.loc
etki alanı oluşturabilmem için temel bir master / catch-all vhost config ile geliştirme nginx / PHP sunucumu kurmaya çalışıyorum .
server {
listen 80;
index index.html index.htm index.php;
# Test 1
server_name ~^(.+)\.frameworks\.loc$;
set $file_path $1;
root /var/www/frameworks/$file_path/public;
include /etc/nginx/php.conf;
}
Ancak, nginx bu kurulum için bir 404 hatasıyla yanıt verir. Ben nginx ve PHP çalışıyorum biliyorum ve localhost
kullandığım yapılandırma iyi çalışıyor çünkü izin var .
server {
listen 80 default;
server_name localhost;
root /var/www/localhost;
index index.html index.htm index.php;
include /etc/nginx/php.conf;
}
Sorunu bulmak için neleri kontrol etmeliyim? Her ikisi de yüklüyor php.conf bir kopyası.
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_index index.php;
# Keep these parameters for compatibility with old PHP scripts using them.
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# Some default config
fastcgi_connect_timeout 20;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_pass 127.0.0.1:9000;
}