61 lines
1.3 KiB
Nginx Configuration File
61 lines
1.3 KiB
Nginx Configuration File
user nginx;
|
|
worker_processes 5;
|
|
error_log /var/log/nginx/error.log;
|
|
pid /var/run/nginx.pid;
|
|
worker_rlimit_nofile 8192;
|
|
|
|
events {
|
|
worker_connections 4096;
|
|
}
|
|
|
|
|
|
http {
|
|
|
|
include mime.types;
|
|
# include fastcgi.conf;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
|
|
access_log /var/log/nginx/access.log main;
|
|
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
server_names_hash_bucket_size 128;
|
|
keepalive_timeout 65;
|
|
gzip on;
|
|
|
|
# virtual host
|
|
server{
|
|
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
|
|
server_name mydomain.com www.mydomain.com;
|
|
|
|
root /vhost/public_html;
|
|
index index.php;
|
|
|
|
error_log /var/log/nginx/mydomain.error.log;
|
|
access_log /var/log/nginx/mydomain.access.log main;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php?url=$uri;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
include fastcgi_params;
|
|
fastcgi_pass php-fpm:9000;
|
|
fastcgi_index index.php;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|