VPS侦探论坛

 找回密码
 注册
查看: 3909|回复: 5

军哥,lnmp1。4,加了ssl后,magento系统做了http跳转到https,发现网站所有保存功能不能用了

[复制链接]
发表于 2017-6-15 12:19:51 | 显示全部楼层 |阅读模式

军哥,lnmp1。4,加了ssl后,magento系统做了http跳转到https,发现网站所有保存功能不能用了。http如果不做跳转,http和https访问都没有问题,但是做跳转就不好用了
跳转代码如下:
server
    {
        listen 80;
        #listen [::]:80;
        server_name www.test.com tset.com;
        return 301 https://www.test.com$request_uri;
    }


生成的session是不可写的,求解,谢谢军哥。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-6-15 14:06:46 | 显示全部楼层

回复 1# 的帖子



可能magento后台 Use Secure URLs in Frontend 和 Use Secure URLs 没开启
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-6-15 14:12:08 | 显示全部楼层

回复 2# 的帖子


Use Secure URLs in Frontend 和 Use Secure URLs,都开启了,如果http和https分别访问都没问题,就是加了那个301跳转后,就不能保存了。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-6-16 09:20:20 | 显示全部楼层



这个就不打清楚了,可能保存功能页面上有http的链接
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-6-16 11:47:38 | 显示全部楼层

回复 4# 的帖子


如果不做强制http使用https访问的跳转,分别访问http和https都没问题,实在是找不到原因了,帮看下配置文件,是不是哪里有问题
magento的伪静态:
location / {
        index index.html index.php; ## Allow a static html file to be shown first
        try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
        expires 30d; ## Assume all files are cachable
    }

    ## These locations would be hidden by .htaccess normally
    location /app/                { deny all; }
    location /includes/           { deny all; }
    location /lib/                { deny all; }
    location /media/downloadable/ { deny all; }
    location /pkginfo/            { deny all; }
    location /report/config.xml   { deny all; }
    location /var/                { deny all; }
    location /downloader/         { deny all; }

    location /var/export/ { ## Allow admins only to view export folder
        auth_basic           "Restricted"; ## Message shown in login window
        auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
        autoindex            on;
    }
      location  /. { ## Disable .htaccess and other hidden files
        return 404;
    }

    location @handler { ## Magento uses a common front handler
        rewrite / /index.php;
    }

    location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
        rewrite ^(.*.php)/ $1 last;
    }

sever的配置:
server
    {
        listen 80;
        #listen [::]:80;
        server_name www.testA.com testA.com;
        return 301 https://www.testA.com$request_uri;
    }

server
    {
        listen 443 ssl http2;
        #listen [::]:443 ssl http2;
        server_name www.testA.com testA.com;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/program/testA;
        ssl on;
        ssl_certificate /etc/letsencrypt/live/www.testA.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/www.testA.com/privkey.pem;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers "EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
        ssl_session_cache builtin:1000 shared:SSL:10m;
        # openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
        ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;

        include mg.conf;
        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*.php$ { deny all; }

        include enable-php.conf;
        
        location ~ [^/].php(/|$)
        {
            # comment try_files $uri =404; to enable pathinfo
            try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
        }

        location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
        {
            expires      30d;
        }

        location ~ .*.(js|css)?$
        {
            expires      12h;
        }

        location ~ /.well-known {
            allow all;
        }

        location ~ /.
        {
            deny all;
        }

        access_log  /home/wwwlogs/www.testA.com.log;
    }

[ 本帖最后由 gfjustme 于 2017-6-16 11:48 编辑 ]

军哥运维代购:http://shop63846532.taobao.com/

发表于 2017-6-16 18:15:34 | 显示全部楼层

回复 5# 的帖子


这个和配置文件应该没关系,建议去官方论坛问一下
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 23:22 , Processed in 0.026712 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表