小新支付系统支持服务商的OEM,可为服务商单独设置访问域名,网站界面的配置。

新增服务商

登录运营平台,新增服务商。设置OEM域名和服务商有效期。设置OEM域名后,表示该服务商开启了OEM功能。

OEM配置

登录运营平台,系统管理 - 系统设置 - 其他设置 - OEM默认项,可以配置平台默认OEM配置。

开启了OEM的服务商,登录服务商系统,系统管理 - OEM配置,可以配置服务商自己的OEM配置。

域名配置

当有网站需要OEM时, 需按如下步骤进行配置。 以【oemoempay.com】为示例进行操作。

准备工作:

  • 请确保域名已正常备案,或通过其他途径可正常解析到小新支付系统的服务器IP。
  • 如暂时不可解析, 可本地配置 host 文件临时测试访问 (如备案问题有可能被阿里云拦截)
  1. 登录运营平台 找到等待OEM的服务商,点击【编辑】将域名配置到OEM域名选项, 并点击保存按钮。

注意域名的要求。

  1. 配置全局upstream ( 仅第一次需配置 )

进入小新支付的主解析服务器的宝塔面板,[软件商店] –》 [Nginx 1.18.0] –》[修改配置]

将以下内容粘贴到 【include /www/server/panel/vhost/nginx/*.conf;】 上面。

upstream upstream_mgr_jeepay_cn {
    server 124.70.0.105:8202 weight=1 max_fails=2 fail_timeout=30s;
}

upstream upstream_isv_jeepay_cn {
    server 124.70.0.105:8206 weight=1 max_fails=2 fail_timeout=30s;
}

upstream upstream_agent_jeepay_cn {
    server 124.70.0.105:8203 weight=1 max_fails=2 fail_timeout=30s;
}

upstream upstream_mch_jeepay_cn {
    server 124.70.0.105:8204 weight=1 max_fails=2 fail_timeout=30s;
}

upstream upstream_pay_jeepay_cn {
    server 124.70.0.105:8201 weight=1 max_fails=2 fail_timeout=30s;
}

upstream upstream_mbr_jeepay_cn {
    server 124.70.0.105:8207 weight=1 max_fails=2 fail_timeout=30s;
}

需注意 实际的应用服务器地址是否正确。

此操作的目的在于, 新增OEM文件时将直接引用该信息。

  1. 新增站点信息

[宝塔 ] –》[网站] –》 【添加站点】

域名填写:oem.oemoempay.com (此仅作为一个标识, 实际所有的二级域名的解析将由配置文件内完成)

将默认的配置文件替换为以下内容 (http / https 其中选择一个):

http配置

    # 官网 / 商户 
    server {
        listen       80;
        server_name  www.oemoempay.com;
        location / {
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_set_header Host  $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://upstream_mch_jeepay_cn;
        }
    }

    # ISV
    server {
        listen       80;
        server_name  isv.oemoempay.com;
        location / {
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_set_header Host  $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://upstream_isv_jeepay_cn;

        }
    }

    # 代理商 
    server {
        listen       80;
        server_name  agent.oemoempay.com;
        location / {
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_set_header Host  $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://upstream_agent_jeepay_cn;

        }
    }

    # 支付平台 
    server {
        listen       80;
        server_name  pay.oemoempay.com;
        location / {
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_set_header Host  $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://upstream_pay_jeepay_cn;

        }
    }

HTTPS 配置

    # 官网 / 商户 
    server {
        listen       80;
        listen 443 ssl http2;
        server_name  www.oemoempay.com;

        #HTTP_TO_HTTPS_START
        if ($server_port !~ 443){
            rewrite ^(/.*)$ https://$host$1 permanent;
        }

        ssl_certificate    /www/server/panel/vhost/cert/oem.oemoempay.com/www.pem;   # 请替换证书文件为真实路径
        ssl_certificate_key    /www/server/panel/vhost/cert/oem.oemoempay.com/www.key;   # 请替换证书文件为真实路径
        ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;
        error_page 497  https://$host$request_uri;

        location / {
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_set_header Host  $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://upstream_mch_jeepay_cn;
        }
    }

    # ISV
    server {
        listen       80;
        listen 443 ssl http2;
        server_name  isv.oemoempay.com;

        #HTTP_TO_HTTPS_START
        if ($server_port !~ 443){
            rewrite ^(/.*)$ https://$host$1 permanent;
        }

        ssl_certificate    /www/server/panel/vhost/cert/oem.oemoempay.com/isv.pem;   # 请替换证书文件为真实路径
        ssl_certificate_key    /www/server/panel/vhost/cert/oem.oemoempay.com/isv.key;   # 请替换证书文件为真实路径
        ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;
        error_page 497  https://$host$request_uri;

        location / {
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_set_header Host  $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://upstream_isv_jeepay_cn;
        }
    }

    # 代理商 
    server {
        listen       80;
        listen 443 ssl http2;
        server_name  agent.oemoempay.com;

        #HTTP_TO_HTTPS_START
        if ($server_port !~ 443){
            rewrite ^(/.*)$ https://$host$1 permanent;
        }

        ssl_certificate    /www/server/panel/vhost/cert/oem.oemoempay.com/agent.pem;   # 请替换证书文件为真实路径
        ssl_certificate_key    /www/server/panel/vhost/cert/oem.oemoempay.com/agent.key;   # 请替换证书文件为真实路径
        ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;
        error_page 497  https://$host$request_uri;

        location / {
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_set_header Host  $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://upstream_agent_jeepay_cn;
        }
    }

    # 支付平台 
    server {
        listen       80;
        listen 443 ssl http2;
        server_name  pay.oemoempay.com;

        #HTTP_TO_HTTPS_START
        if ($server_port !~ 443){
            rewrite ^(/.*)$ https://$host$1 permanent;
        }

        ssl_certificate    /www/server/panel/vhost/cert/oem.oemoempay.com/pay.pem;   # 请替换证书文件为真实路径
        ssl_certificate_key    /www/server/panel/vhost/cert/oem.oemoempay.com/pay.key;   # 请替换证书文件为真实路径
        ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 10m;
        error_page 497  https://$host$request_uri;

        location / {
            proxy_next_upstream http_502 http_504 error timeout invalid_header;
            proxy_set_header Host  $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://upstream_pay_jeepay_cn;
        }
    }
  1. 登录服务商系统

系统管理 –》 OEM配置 进行网站的设置操作。

访问: http://www.oemoempay.com 查看网站效果。

文档更新时间: 2021-10-22 18:21   作者:大森林