您好,欢迎访问一九零五行业门户网

first nginx & php

pc-nginx-apache(for test install easy) http { upstream myapp1 { //---for balance server srv1.example.com; server srv2.example.com; server srv3.example.com; } server { listen 80; location / { proxy_pass http://myapp1; } }} server { location
pc->nginx->apache(for test install easy)http { upstream myapp1 { //---for balance server srv1.example.com; server srv2.example.com; server srv3.example.com; } server { listen 80; location / { proxy_pass http://myapp1; } }}
server { location / { proxy_pass http://localhost:8080/; //---to apache } location ~ \.(gif|jpg|png)$ { //---to local root /data/images; }}
------------------------------------------- 
envkernel:3.10.0-123.el7.x86_64
nginx version: nginx/1.4.7   ./configure --prefix=/usr/local/nginx/ --with-pcre=/usr/local/pcre-7.9/(source code path) --with-zlib=/usr/local/zlib-1.2.8/(source code path)
php version :5.5.20 auto enable fastcgi    ./configure --prefix=/usr/local/php --enable-debug --enable-fpm
config
1 #user nobody; 2 worker_processes 1; 3 4 #error_log logs/error.log; 5 #error_log logs/error.log notice; 6 #error_log logs/error.log info; 7 8 #pid logs/nginx.pid; 9 10 11 events {12 worker_connections 1024;13 }14 15 16 http {17 include mime.types;18 default_type application/octet-stream;19 20 #log_format main '$remote_addr - $remote_user [$time_local] $request '21 # '$status $body_bytes_sent $http_referer '22 # '$http_user_agent $http_x_forwarded_for';23 24 #access_log logs/access.log main;25 26 sendfile on;27 #tcp_nopush on;28 29 #keepalive_timeout 0;30 keepalive_timeout 65;31 32 #gzip on;33 34 server {35 listen 80;36 server_name localhost;37 38 #charset koi8-r;39 40 #access_log logs/host.access.log main;41 42 location / {43 root html;44 index index.php index.html index.htm;45 }46 47 #error_page 404 /404.html;48 49 # redirect server error pages to the static page /50x.html50 #51 error_page 500 502 503 504 /50x.html;52 location = /50x.html {53 root html;54 }55 56 # proxy the php scripts to apache listening on 127.0.0.1:8057 #58 #location ~ \.php$ {59 # proxy_pass http://127.0.0.1;60 #}61 62 # pass the php scripts to fastcgi server listening on 127.0.0.1:900063 #64 location ~ \.php$ {65 root /usr/local/nginx/html;66 fastcgi_pass 127.0.0.1:9000;67 fastcgi_index index.php;68 include fastcgi.conf;69 }70 71 # deny access to .htaccess files, if apache's document root72 # concurs with nginx's one73 #74 #location ~ /\.ht {75 # deny all;76 #}77 }78 }
nginx.conf/usr/local/php/sbin/php-fpm
/usr/local/nginx/sbin/nginx 
sysctl stop firewalld.service
systemctl stop firewalld.service
result
[root@localhost conf]# curl 127.0.0.1 | head
% total % received % xferd average speed time time time current
dload upload total spent left speed
100 56014 0 56014 0 0 9.8m 0 --:--:-- --:--:-- --:--:-- 10.6m
其它类似信息

推荐信息