Ssl 为什么prestashop不能与ssh一起正常工作?
因此,当使用ssl时,我对prestashop 1.6有问题。如果我签入启用ssl,但不在任何有问题的地方都检查启用ssl-消息太多重定向。如果我检查了两个参数,一切正常。我的配置:Nginx+php-fpm 这是我的配置:Ssl 为什么prestashop不能与ssh一起正常工作?,ssl,nginx,prestashop-1.6,Ssl,Nginx,Prestashop 1.6,因此,当使用ssl时,我对prestashop 1.6有问题。如果我签入启用ssl,但不在任何有问题的地方都检查启用ssl-消息太多重定向。如果我检查了两个参数,一切正常。我的配置:Nginx+php-fpm 这是我的配置: server { ### Ports listen 80; listen 443 ssl; ###SSL PART ssl_certificate /etc/ssl/certs/mysite.crt; ssl_certificate_k
server {
### Ports
listen 80;
listen 443 ssl;
###SSL PART
ssl_certificate /etc/ssl/certs/mysite.crt;
ssl_certificate_key /etc/ssl/certs/server.key;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_session_cache shared:SSL:40m;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384:DHE-RSA-AES128-GCM-SHA128:ECDHE-RSA-AES128-SHA384:ECDHE-RSA-AES128-SHA128:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA384:AES128-GCM-SHA128:AES128-SHA128:AES128-SHA128:AES128-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
#ssl_stapling on;
#ssl_stapling_verify on;
#resolver 156.154.70.1 8.8.8.8 valid=300s;
#resolver_timeout 10s;
###Headers
add_header "X-UA-Compatible" "IE=Edge";
add_header Strict-Transport-Security "max-age=63072000";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
###LOGS
access_log /var/log/nginx/mysite.access.log;
error_log /var/log/nginx/mysite.error.log;
###Charset
charset utf-8;
###BASIC
server_name mysite.com www.mysite.com;
root /var/www/html;
index index.php index.html;
###REWRITE
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-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last;
rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+.jpg$ /img/c/$1.jpg last;
rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last;
rewrite ^/order$ /index.php?controller=order last;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php last;
}
# Redirect needed to "hide" index.php
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
###Cache
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location ~* \.(gif)$ {
expires 2592000s;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~* \.(jpeg|jpg)$ {
expires 2592000s;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~* \.(png)$ {
expires 2592000s;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~* \.(css)$ {
expires 604800s;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~* \.(js|jsonp)$ {
expires 604800s;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~* \.(js)$ {
expires 604800s;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~* \.(ico)$ {
expires 31536000s;
add_header Pragma public;
add_header Cache-Control "public";
}
location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
expires 1M;
access_log off;
add_h`enter code here`eader Cache-Control "public";
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
}尝试更改
到
我记得我的配置中需要默认的单词
缓冲区大小参数也是非常重要的
我发现以下配置可以工作。该站点随机收到错误的网关响应,您需要允许更多缓冲区大小和超时。
Prestashop在请求中发送了大量内容,这使得nginx使用默认配置失败。遗憾的是,官方的prestashop配置中没有记录这一点
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;
listen 443 default ssl;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;