[GH-ISSUE #177] nginx 不能反向代理 #107

Closed
opened 2026-03-03 00:31:29 +03:00 by kerem · 2 comments
Owner

Originally created by @nuo010 on GitHub (Oct 9, 2024).
Original GitHub issue: https://github.com/certimate-go/certimate/issues/177

ee35b7b670497ec58bcac7a7e93b377

nginx 配置反向代理, 配置后前端无法访问, 因为带有ssl前搓, js文件请求不到
image

Originally created by @nuo010 on GitHub (Oct 9, 2024). Original GitHub issue: https://github.com/certimate-go/certimate/issues/177 <img width="161" alt="ee35b7b670497ec58bcac7a7e93b377" src="https://github.com/user-attachments/assets/f2b4ebb2-2fda-411d-bbed-c7103c8d249b"> nginx 配置反向代理, 配置后前端无法访问, 因为带有ssl前搓, js文件请求不到 ![image](https://github.com/user-attachments/assets/15cf344e-94ab-4814-8de7-0d2ac05786fb)
kerem 2026-03-03 00:31:29 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@usual2970 commented on GitHub (Oct 9, 2024):

感谢反馈~这种问题和 certimate 无关,请自行百度一下

<!-- gh-comment-id:2402375258 --> @usual2970 commented on GitHub (Oct 9, 2024): 感谢反馈~这种问题和 certimate 无关,请自行百度一下
Author
Owner

@NorthNanmu commented on GitHub (Aug 9, 2025):

@nuo010

location ^~ /certimate/
        {
            proxy_pass http://127.0.0.1:8090/; #后端地址
            proxy_set_header Accept-Encoding ""; #关闭上游gzip压缩
            proxy_redirect / /certmate/; #重定向url
            sub_filter_types *; #对所有请求响应类型都做sub_filter指定的替换
            sub_filter_once off; #执行多次而不是一次
            # 替换所有资源路径
            sub_filter '/assets/' '/certmate/assets/';
            sub_filter '/static/' '/certmate/static/';
            sub_filter '/js/' '/certmate/js/';
            sub_filter '/css/' '/certmate/css/';
            sub_filter '/api/' '/certmate/api/';
            sub_filter '/imgs/' '/certmate/imgs/';
            sub_filter 'href="/' 'href="/certmate/';
            sub_filter 'src="/' 'src="/certmate/';
            sub_filter 'action="/' 'action="/certmate/';
            sub_filter '/logo.svg' '/certmate/logo.svg';
            access_log  /home/wwwlogs/certmate.log;
            }
<!-- gh-comment-id:3169713894 --> @NorthNanmu commented on GitHub (Aug 9, 2025): @nuo010 ```conf location ^~ /certimate/ { proxy_pass http://127.0.0.1:8090/; #后端地址 proxy_set_header Accept-Encoding ""; #关闭上游gzip压缩 proxy_redirect / /certmate/; #重定向url sub_filter_types *; #对所有请求响应类型都做sub_filter指定的替换 sub_filter_once off; #执行多次而不是一次 # 替换所有资源路径 sub_filter '/assets/' '/certmate/assets/'; sub_filter '/static/' '/certmate/static/'; sub_filter '/js/' '/certmate/js/'; sub_filter '/css/' '/certmate/css/'; sub_filter '/api/' '/certmate/api/'; sub_filter '/imgs/' '/certmate/imgs/'; sub_filter 'href="/' 'href="/certmate/'; sub_filter 'src="/' 'src="/certmate/'; sub_filter 'action="/' 'action="/certmate/'; sub_filter '/logo.svg' '/certmate/logo.svg'; access_log /home/wwwlogs/certmate.log; } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/certimate#107
No description provided.