该页面无法在HTTPS中正确重定向

时间:2018-11-15 16:00:22

标签: nginx prestashop lets-encrypt prestashop-1.7

我在centos7上使用nginx服务器和Prestashop 1.7.4.4,还安装了php5.6。 我将nginx配置为可服务3个网站,一个在wordpress中,一个是代理Tomcat的代理,另一个是与prestashop代理的。

没有HTTPS,一切都很好。 我安装证书的certbot并运行它。 它做了3个站点文件配置。 现在,prestashop旁边的所有站点都可以正常运行,并且如果尝试使用HTTP进行连接的尝试重定向到HTTPS。

我通过这样的命令行安装prestashop:

SELECT a.EXAM_DEGREE_ID,a.MAJOR_GROUP_ID,a.INSTITUTION,a.BOARD,a.RESULT_GRADE,a.PASSING_YEAR,f.ELEMENT_URL
FROM student_acadimicinfo a
left join m00_lkpdata b on a.EXAM_DEGREE_ID=b.LKP_ID
left join m00_lkpdata c on a.MAJOR_GROUP_ID=c.LKP_ID
left join m00_lkpdata d on a.BOARD = d.LKP_ID
left join STUDENT_PERSONAL_INFO e on e.STUDENT_ID = a.STUDENT_ID
left join SKILL_DEV_ELEMENT f on f.APPLICANT_ID = e.APPLICANT_ID
WHERE a.STUDENT_ID ='341'
group by a.EXAM_DEGREE_ID,a.MAJOR_GROUP_ID,a.INSTITUTION,a.BOARD,a.RESULT_GRADE,a.PASSING_YEAR,f.ELEMENT_URL

在没有https的情况下可以正常工作,但是一旦我安装了证书并将流量从http重定向到https,浏览器就会显示臭名昭著:

 php index_cli.php --name=name --country=it --domain=www.namedoamin.com --db_server=127.0.0.1 --db_name=dbname --db_user=dbuser --db_password=password

关于此问题的信息很多,但没有一个对我有帮助。 这是来自nginx的块:

The page isn’t redirecting properly

如果我进入管理部分,它可以在HTTPS中运行,但是如果我尝试进入设置/常规,它会给我404找不到,很奇怪! 我不知道该做什么了,我已经绝望了,在发布之前,我尝试了所有在互联网上使用的技巧。

更新: 几小时后,我一经发布就经常找到解决方法。 这是我不知道出于任何原因无法访问设置/常规的问题所在。因此,我进入了数据库表pl_configuration,将名为server { server_name www.name.com; location / { root /var/www/html/website.com; index index.php index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location ~ \.php$ { root /var/www/html/website.com; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; include /etc/nginx/fastcgi_params; } listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/www.namesite.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/www.namesite.com/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot server { if ($host = www.namesite.com) { return 301 https://$host$request_uri; } # managed by Certbot server_name www.namesite.com; listen 80; return 404; # managed by Certbot } PS_SSL_ENABLED_EVERYWHERE

的字段更改为true

1 个答案:

答案 0 :(得分:1)

一开始我遇到了同样的问题,但是随后(在管​​理界面中)更改了商店参数> General,方法是在每个页面上启用ssl(首先启用ssl,然后保存,然后在所有页面上启用ssl),然后清除缓存,然后工作正常。
以防万一。

相关问题