Ich bin kein Profi was nginx angeht, aber hier ist ein Auszug meiner nginx Config:
Code:
# nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 64;
client_max_body_size 1G;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
listen 443 ssl;
server_name localhost;
root /www;
index index.html index.htm index.php;
ssl_certificate /nginx/conf/nginx.crt;
ssl_certificate_key /nginx/conf/nginx.key;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_read_timeout 120;
fastcgi_index index.php;
include fastcgi.conf;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
}
# contao.local
server {
listen 80;
listen 443 ssl;
server_name contao.local;
root /www/contao/web;
include contao4.conf;
}
}
Code:
# contao4.conf
location / {
try_files $uri /app.php$is_args$args;
}
location ~ ^/(index|app)\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_read_timeout 120;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi.conf;
internal;
}
location ~ ^/(app_dev|preview|contao-manager\.phar)\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_read_timeout 120;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi.conf;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_read_timeout 120;
include fastcgi.conf;
try_files $uri /app.php$is_args$args;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
log_not_found off;
try_files $uri /app.php$is_args$args;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
try_files $uri /app.php$is_args$args;
}
location ~ /\.ht {
deny all;
}
Lesezeichen