firemail
标题:
nginx配置php
[打印本页]
作者:
Qter
时间:
2020-6-5 19:21
标题:
nginx配置php
nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
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;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
server {
listen 80;
server_name localhost;
location / {
root /data/www/file;
index /promotion/jc_app_downlaod.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
复制代码
conf.d/xx.conf
# admin-api
server {
listen 8102;
server_name 192.168.124.48;
root /data/www/admin-api/public;
client_max_body_size 18M;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param APP_ENV dev;
include fastcgi_params;
}
location ~/\.ht {
deny all;
}
}
# admin web
server {
listen 8110;
server_name 192.168.124.48;
location / {
root /data/web/admin/dist/;
index index.html;
}
location ^~/api/ {
proxy_pass http://127.0.0.1:8102/;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
}
}
server {
listen 8080;
server_name 192.168.124.48;
location / {
root /var/www;
index index.html index.htm;
}
# location custom_service {
#}
}
复制代码
欢迎光临 firemail (http://firemail.wang:8088/)
Powered by Discuz! X3