nginx 配置

Nginx · Fecmall · 于 6年前 发布 · 2098 次阅读

nginx配置:


# PhpMyAdmin
server {
    listen       80;
    server_name my.fecshop.com;
    root  /www/web/online/phpmyadmin;
    server_tokens off;
	include none.conf;
	index index.php index.html index.htm;
#	access_log /www/web_logs/access.log wwwlogs;
#	error_log  /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;
	}
}


# Appadmin

server {
    listen     80  ;
    server_name appadmin.fecshop.com;
    root  /www/web/online/fecshop-1.3.0.3/appadmin/web;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /www/web_logs/access.log wwwlogs;
    error_log  /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;
    }
}


# AppFront
server {
    listen     80  ;
	server_name appfront.fecshop.com appfront.fecshop.es;
    root  /www/web/online/fecshop-1.3.0.3/appfront/web;
	server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /www/web_logs/access.log wwwlogs;
    error_log  /www/web_logs/error.log  notice;
    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        include fcgi.conf;
    }

	location ~ /sitemap.xml 
	{   
		if ($host  ~ .*appfront.fecshop.es) {  
			rewrite ^/sitemap\.xml /sitemap_es.xml last;  
		}
	}

	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;
    }
}



# AppHtml5
server {
    listen     80  ;
    server_name apphtml5.fecshop.com apphtml5.fecshop.es;
    root  /www/web/online/fecshop-1.3.0.3/apphtml5/web;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /www/web_logs/access.log wwwlogs;
    error_log  /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 /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 ~ .*\.(js|css)?$ {
        expires      12h;
    }
    location /api {
        rewrite /api/([a-z][0-9a-z_]+)/?$ /api.php?type=$1;
    }
}


# AppApi
server {
    listen     80  ;
    server_name appapi.fecshop.com;
    root  /www/web/online/fecshop-1.3.0.3/appapi/web;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    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;
	}
}

#AppServer
server {
    listen     80  ;
    server_name appserver.fecshop.com;
    root  /www/web/online/fecshop-1.3.0.3/appserver/web;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /www/web_logs/access.log wwwlogs;
    error_log  /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;
    }
}


# img
server {
    listen     80  ;
    server_name img.fecshop.com;
    root  /www/web/online/fecshop-1.3.0.3/appimage/common;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /www/web_logs/access.log wwwlogs;
    error_log  /www/web_logs/error.log  notice;
	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
        expires      30d;
    }
}



# img2
server {
    listen     80  ;
    server_name img2.fecshop.com;
    root  /www/web/online/fecshop-1.3.0.3/appimage/appadmin;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /www/web_logs/access.log wwwlogs;
    error_log  /www/web_logs/error.log  notice;
	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
        expires      30d;
    }
}

# img3
server {
    listen     80  ;
    server_name img3.fecshop.com;
    root  /www/web/online/fecshop-1.3.0.3/appimage/appfront;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /www/web_logs/access.log wwwlogs;
    error_log  /www/web_logs/error.log  notice;
	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
        expires      30d;
    }
}


# img4
server {
    listen     80  ;
    server_name img4.fecshop.com;
    root  /www/web/online/fecshop-1.3.0.3/appimage/apphtml5;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /www/web_logs/access.log wwwlogs;
    error_log  /www/web_logs/error.log  notice;
	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
        expires      30d;
    }
}


# img5
server {
    listen     80  ;
    server_name img5.fecshop.com;
    root  /www/web/online/fecshop-1.3.0.3/appimage/appserver;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /www/web_logs/access.log wwwlogs;
    error_log  /www/web_logs/error.log  notice;
	location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
        expires      30d;
    }
}

# VUE
server {
    listen     80;
    server_name vue.fecshop.com;
    root  /www/web/online/vue_fecshop_appserver/dist ;
    server_tokens off;
    include none.conf;
    index index.php index.html index.htm;
    access_log /www/web_logs/access.log wwwlogs;
    error_log  /www/web_logs/error.log  notice;
    
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
            expires      30d;
    }

    location ~ .*\.(js|css)?$ {
            expires      12h;
    }
}


共收到 0 条回复
没有找到数据。
添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics