Nginx, HTTPS configuration

Source: Internet
Author: User

server {
Listen 443; # # #HTTPS指定端口
server_name www.web.com; # # # #域名或者IP

Root/data/wwwroot/laravel/public; # # # #项目所在绝对路径, project portal
Index index.php index.html index.htm;

########################################################
# # HTTPS # #
SSL on;

Ssl_certificate/usr/local/nginx/cert/214235201250226.pem;
Ssl_certificate_key/usr/local/nginx/cert/214235201250226.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;
#########################################################

Try_files $uri $uri/@rewrite;

Location @rewrite {
Rewrite ^/(. *) $/index.php?_url=/$1;
}

Location/nginx_status {
Stub_status on;
Access_log off;
Allow 127.0.0.1;
Deny all;
}

Location ~ [^/]\.php (/|$) {
# Fastcgi_pass remote_php_ip:9000;
Fastcgi_pass Unix:/dev/shm/php-cgi.sock;
Fastcgi_index index.php;

####################################################
# # HTTPS # #
Fastcgi_param HTTPS on;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
####################################################

Include fastcgi.conf;
}

Location ~. *\. (Gif|jpg|jpeg|png|bmp|swf|flv|ico) $ {
Expires 30d;
# Access_log off;
}

Location ~. *\. (JS|CSS)? $ {
Expires 7d;
Access_log off;
}

}

Nginx, HTTPS configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.