• 欢迎访问VPS岛网站,国外VPS,国内VPS,国外服务器,国内服务器,服务器主机,测评及优惠码,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站 QQ群

安装nginx

Nginx相关 猩球崛起 89次浏览 已收录 0个评论
nginx 不仅可以做反向代理,也可以做正向代理(代理上网)
http://nginx.org/en/download.html

yum install gcc-c++
yum install pcre
yum install pcre-devel
yum install zlib
yum install zlib-devel
yum install openssl
yum install openssl-devel
./configure –prefix=/usr/local/nginx –with-pcre –with-http_ssl_module(https)
配置https

nginx 阿里云
    server {
    listen 6301;
    server_name xxxxxxx;
    ssl on;

    ssl_certificate   cert/xxxxxx.pem;
    ssl_certificate_key  cert/xxxxxx.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    location / {

                  root /home/nginx/xxx;
                  try_files $uri /index.html;
                  expires       max;

             }
        }

nginx.conf

#user  nobody;
worker_processes  8;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
error_log  /usr/local/ngin/logs/error.log  info;

pid        /usr/local/nginx/logs/nginx.pid;

worker_rlimit_nofile 65535;
events {
    worker_connections  65535;
}

http {
    include       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  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    upstream tomcat {
         #ip_hash;
             server xxx:8200;
             server xxx:8201;
    }

    #gzip  on;

    server {
        listen       8180;
        server_name xxxxx;
        ssl on;

        ssl_certificate   /usr/local/nginx/cert/xxxx.pem;
        ssl_certificate_key /usr/local/nginx/cert/xxxxxx.key;
        ssl_session_timeout 5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
            #charset koi8-r;

        #access_log  logs/host.access.log  main;
        location ^~ /txserver/ {
            proxy_pass http://tomcat;

        }
        location / {
             root /usr/local/nginx/xxx;
             try_files $uri /index.html;
              expires       max;

        }

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

}

VPS岛 的文章和资源来自互联网,仅作为参考资料,如果有侵犯版权的资源请尽快联系站长,我们会在24h内删除有争议的资源。丨 转载请注明安装nginx
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址