本文主要是介绍Prestashop SSL配置,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
在给 Web 安装 ssl 前我需要将应用程序本地下载安装,
这也算对 Prestashop 应用程序进行搬家了。在这转移过程中还真遇到不少问题。
Ssl 是我自己生成的做测试的 ( ssl 生成)
生成后将证书放入
# pwd
/usr/local/nginx/cert
# ll
test.crt
test.key
注意要读的权限
# pwd
/usr/local/nginx/conf/vhost
# vi test.conf
server {
listen 80;
listen 443 default ssl;
server_name new-test.com www.new-test.com;
charset UTF-8;
error_log /var/log/nginx/ new-test.log;
root /home/Dev/ new-test /;
error_page 404 /404.html;
index index.php index.html index.htm;
#ssl on;
ssl_session_cache shared:SSL:10m;
ssl_certificate /usr/local/nginx/cert/test.crt;
ssl_certificate_key /usr/local/nginx/cert/test.key;
rewrite ^/api$ api/ last;
rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$1$2$3.jpg last;
rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last;
rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
rewrite ^/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2$3.jpg last;
rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last;
# AlphaImageLoader for IE and fancybox
rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 last;
#rewrite ^/.*$ /index.php last;
#if (!-f $request_filename ){
# rewrite ^(.*)$ /index.php last;
#}
#location / {
# try_files $uri $uri/ /index.php?q=$uri&$args;
#}
location / {
if (!-e $request_filename) {
rewrite ^/.*$ /index.php last;
}
}
location /qyaimus/ { #Change this to your admin folder
if (!-e $request_filename) {
rewrite ^/?$ /qyaimus/index.php?controller=AdminLogin last;
rewrite ^/.*$ /qyaimus/index.php last; #Change this to your admin folder
break;
}
}
location ~ \.(jpg|jpeg|png|js|css|flash|woff|woff2|ttf)$ {
expires 30d;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_connect_timeout 10;
fastcgi_read_timeout 180;
fastcgi_send_timeout 180;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.(ht|ba) {
deny all;
}
}
这是我的配置
还需要最后一步,需进入后台进行设置
Shop Parameters -> General
OK 到目前这次的任务算是完成了
这篇关于Prestashop SSL配置的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!