服务器是使用Nginx 是第一次配置的。是下载教程里面的Nginx配置。更改成自己的文件路径和相关域名的。
网站是存放在了
/var/www/html/fechsop/目录下面
以下是Nginx的default.conf文件。
server {
listen 80 ;
server_name appadmin.fecshoptest.com;
root /var/www/html/fecshop/appadmin/web;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /var/www/web_logs/access.log wwwlogs;
error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
location /api {
rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
}
}
server {
listen 80 ;
server_name appfront.fecshoptest.com;
root /var/www/html/fecshop/appfront/web;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /var/www/web_logs/access.log wwwlogs;
error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location /fr/ {
index index.php;
if (!-e $request_filename){
rewrite . /fr/index.php last;
}
}
location /es/ {
index index.php;
if (!-e $request_filename){
rewrite . /es/index.php last;
}
}
location /cn/ {
index index.php;
if (!-e $request_filename){
rewrite . /cn/index.php last;
}
}
location /de/ {
index index.php;
if (!-e $request_filename){
rewrite . /de/index.php last;
}
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
location /api {
rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
}
}
server {
listen 80 ;
server_name appapi.fecshoptest.com;
root /var/www/html/fecshop/appapi/web;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /var/www/web_logs/access.log wwwlogs;
error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
}
server {
listen 80 ;
server_name apphtml5.fecshoptest.com;
root /var/www/html/fecshop/apphtml5/web;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /var/www/web_logs/access.log wwwlogs;
error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
location /api {
rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
}
}
server {
listen 80 ;
server_name appserver.fecshoptest.com;
root /var/www/html/fecshop/appserver/web;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /var/www/web_logs/access.log wwwlogs;
error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
location /api {
rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
}
}
server {
listen 80;
listen 443 ssl;
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_certificate ssl/market_onfancy_com.crt;
#ssl_certificate_key ssl/server.key;
server_name fancyecommerce.com;
return 301 $scheme://www.fancyecommerce.com$request_uri;
}
server {
listen 80;
server_name rockmongo.fancyecommerce.com;
root /www/web/online/rockmongo-1.1.7;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
# access_log /var/www/web_logs/access.log wwwlogs;
# error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
location /api {
rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
}
}
server {
listen 100;
server_name 120.24.37.249;
root /www/web/online/fancyecommerce.com/frontend/web;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
# access_log /var/www/web_logs/access.log wwwlogs;
# error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
location /api {
rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
}
}
server {
listen 80;
listen 443 ssl;
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_certificate ssl/market_onfancy_com.crt;
#ssl_certificate_key ssl/server.key;
server_name fecshop.com;
return 301 $scheme://www.fecshop.com$request_uri;
}
server {
listen 80 ;
server_name img.fecshoptest.com;
root /var/www/html/fecshop/appimage/common;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /var/www/web_logs/access.log wwwlogs;
error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
}
server {
listen 80 ;
server_name img2.fancyecommerce.com;
root /var/www/html/fecshop/appimage/appadmin;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /var/www/web_logs/access.log wwwlogs;
error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
}
server {
listen 80 ;
server_name img3.fecshoptest.com;
root /var/www/html/fecshop/appimage/appfront;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /var/www/web_logs/access.log wwwlogs;
error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
}
server {
listen 80 ;
server_name img4.fecshoptest.com;
root /var/www/html/fecshop/appimage/apphtml5;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /var/www/web_logs/access.log wwwlogs;
error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
}
server {
listen 80 ;
server_name img5.fecshoptest.com;
root /var/www/html/fecshop/appimage/appserver;
server_tokens off;
include none.conf;
index index.php index.html index.htm;
access_log /var/www/web_logs/access.log wwwlogs;
error_log /var/www/web_logs/error.log notice;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
}