nginx配置

需求:

1.访问 test.com ,跳转到https://test2.com/goto.php
2. test.com子目录m,不跳转
3. test.com子目录abc,不跳转

nginx配置

server {
   
    listen       80;
    client_max_body_size 60m;
    server_name  test.com;
    location /m {
   
        root   /data/webapp/test/m;
        index  index.php index.html index.htm login.php;
    }
	
    location /abc {
   
        root   /data/webapp/test/abc;
        index  index.php index.html index.htm login.php;
    }

    location / {
   
        root   /data/webapp/test;
        index  index.php index.html index.htm login.php;

		return 301 https://test2.com/goto.php?url=$request_uri;

    }

    access_log   /data/weblogs/test_161_1_access.log  access;



}




server {
   
    listen       443;
    client_max_body_size 60m;
    server_name  test.com;

    ssl          on;
    ssl_certificate      /data/app/nginx/ssl/server.crt;
    ssl_certificate_key  /data/app/nginx/ssl/server.key;

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	ssl_prefer_server_ciphers on;
	ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4:!DH:!DHE;
	ssl_session_timeout 5m;
	ssl_session_cache builtin:1000 shared:SSL:10m;

    location /m {
   
        root   /data/webapp/test;
    }

    location /abc {
   
        root   /data/webapp/test;
    }

    location / {
   
        root   /data/webapp/test;
        index  index.php index.html index.htm login.php;

		return 301 https://test2.com/goto.php?url=$request_uri;

    }

    access_log   /data/weblogs/test_ssl_161_1_access.log  access;





}

相关推荐

  1. nginx配置

    2024-01-13 14:30:02       41 阅读
  2. nginx配置

    2024-01-13 14:30:02       15 阅读
  3. nginx配置

    2024-01-13 14:30:02       7 阅读
  4. NGINX相关配置

    2024-01-13 14:30:02       34 阅读
  5. Nginx的stream配置

    2024-01-13 14:30:02       39 阅读
  6. nginx配置端口转发

    2024-01-13 14:30:02       44 阅读
  7. Nginx conf文件配置

    2024-01-13 14:30:02       31 阅读
  8. Nginx基本配置内容

    2024-01-13 14:30:02       41 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-13 14:30:02       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-13 14:30:02       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-13 14:30:02       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-13 14:30:02       20 阅读

热门阅读

  1. 汇编和C语言转换

    2024-01-13 14:30:02       35 阅读
  2. Linux 脚本中 0 1> 2> >& <的含义

    2024-01-13 14:30:02       35 阅读
  3. Vue高级

    2024-01-13 14:30:02       38 阅读
  4. Oracle VARCHAR和VARCHAR2区别

    2024-01-13 14:30:02       36 阅读
  5. 交换机详细指南

    2024-01-13 14:30:02       35 阅读
  6. 服务器带宽

    2024-01-13 14:30:02       33 阅读