发表于: 2017-06-18 21:03:45

1 886


今天完成的事情:

说实话啥也没完成,说好把服务器弄好提交任务的,结果折腾了一天,服务器初始化6次,nginx.conf文件更改过无数次,依然是访问不成功,mmp!

早知道我先学习svn了,ppt也没写,真的是白白浪费一天,心痛,明天解决不了就不弄了,学svn去了,任务提交直接给你发文件了,本地直接看吧。

附上我百度查到的无数配置方法(我都试过,干他娘的没用):

方法一:

#user  nobody;

worker_processes  1;

error_log  /disk/nginx/logs/error.log;

#error_log  logs/error.log  notice;

#error_log  logs/error.log  info;

pid        logs/nginx.pid;

events {

    worker_connections  2048;

}

http {

    include       mime.types;

    default_type  application/octet-stream;

    access_log  /disk/nginx/logs/host.access.log;

    sendfile        on;

    #tcp_nopush     on;

    #keepalive_timeout  0;

    keepalive_timeout  65;

    #gzip  on;

      limit_req_zone $binary_remote_addr zone=perip:10m rate=1r/s;

       limit_req_zone $server_name zone=perserver:10m rate=10r/s;

    # HTTPS server

    server {

        limit_req zone=perip burst=5 nodelay;

        limit_req zone=perserver burst=10;

        listen 443;

        server_name mp.baidu.com;

        ssl on;

        ssl_certificate  1_mp.baidu.com_bundle.crt;

        ssl_certificate_key  2_mp.baidu.com.key;

        ssl_session_timeout 5m;

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 

        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;

        ssl_prefer_server_ciphers on;

        location /carrots-admin-ajax/ {

            root   /usr/share/nginx/html;

            index  index.html index.htm;

            proxy_pass http://dev.admin.carrots.ptteng.com/; 

        }

    }

}


方法二:

server {

  listen        80;

  server_name   nginx.ninghao.net;

  root          /home/www/nginx.ninghao.net;

  index         index.php index.html;

  location / {

    try_files $uri $uri/ /index.php?$query_string;

  }

  location ~ \.php$ {

    fastcgi_pass 127.0.0.1:9000;

    fastcgi_index index.php;

    include fastcgi.conf;

  }

}


方法三:

 server_name localhost demo.com www.demo.com test.demo.com; 

  

  # 表示默认索引文件 

  index index.html index.htm index.php; 

    

  # 该站点对应的网站根目录所在 

  root /alidata/www/demo; 

  

  location ~ .*\.(php|php5)?$ 

  { 

    #fastcgi_pass unix:/tmp/php-cgi.sock; 

    fastcgi_pass 127.0.0.1:9000; 

    fastcgi_index index.php; 

    include fastcgi.conf; 

  } 

  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ 

  { 

    expires 30d; 

  } 

  location ~ .*\.(js|css)?$ 

  { 

    expires 1h; 

  } 

  

  # 伪静态规则 

  include /alidata/server/nginx/conf/rewrite/phpwind.conf; 

  access_log /alidata/log/nginx/access/phpwind.log; 

算了,不贴了,都是坑人的!!!!!

明天计划的事情:

1.svn的学习(重点);

2.ppt的编写

遇到的问题:

来个大佬告诉我linux系统的ECS的nginx到底该如何配置才能进行跨域访问,成功发送请求!!!!!

收获:

心累


返回列表 返回列表
评论

    分享到