httpsphp into HTTPS

Source: Internet
Author: User

CentOS system, based on Nginx server, with HTTPS access to PHP page total popup download page problem perfect solution
Under Ningx, with http://ip/index.php can access PHP files, and https://ip/index.php always pop up the download dialog box, the problem is that there is no code block parsing php in HTTPS server{}

server {
Listen 443 SSL;
server_name localhost;
SSL on;
SSL_CERTIFICATE/USR/LOCAL/NGINX-1.5.1/CONF/SERVER.CRT;
Ssl_certificate_key/usr/local/nginx-1.5.1/conf/server.key;
Ssl_session_cache shared:ssl:1m;
Ssl_session_timeout 5m;
Ssl_ciphers high:!anull:! MD5;
Ssl_prefer_server_ciphers on;

Location/{
root/usr/local/nginx-1.5.1/html;
Index index.html index.htm hello.php index.php;
}

Location ~. *\. (PHP|PHP5)? $ {
root/usr/local/nginx-1.5.1/html/;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param HTTPS on;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;
#new Line
Include fastcgi.conf;
}
}
The red part is used to parse PHP, when you enter https://ip/index.php will appear index.php page

httpsphp into HTTPS

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.