码迷,mamicode.com
首页 > 其他好文 > 详细

nginx 配置

时间:2019-12-07 18:11:23      阅读:110      评论:0      收藏:0      [点我收藏+]

标签:pre   pcr   usr   set   har   The   str   查看   int   

1、编译安装

[root@bogon nginx-1.6.2]# ./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35
[root@bogon nginx-1.6.2]# make
[root@bogon nginx-1.6.2]# make install

2、查看nginx版本

[root@bogon nginx-1.6.2]# /usr/local/webserver/nginx/sbin/nginx -v

配置项目:
1、把项目放入html 目录下
2、config配置

server {
listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
root html/ess-web/;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

location /cors/{
proxy_pass http://192.168.10.22:8080/;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

 

nginx 配置

标签:pre   pcr   usr   set   har   The   str   查看   int   

原文地址:https://www.cnblogs.com/rh-fernando/p/12002608.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!