avatar

sunday

Sunday's Blog

  • 首页
主页 nginx + acme 不占用80端口申请证书
文章

nginx + acme 不占用80端口申请证书

发表于 10天前 更新于 10天前
作者 sunday 已删除用户
1~2 分钟 阅读

1.在你的域名conf里配置如下

server {
    listen 80;
    listen [::]:80;
    server_name your_domain.com;  # ← 改为你的域名或IP
    location ^~ /.well-known/acme-challenge/ {
        root /var/www/acme;
        default_type "text/plain";
    }
    location / {
        return 301 https://$host$request_uri;
    }
}

确保/var/www/acme 有这个路径文件夹,然后执行证书申请

mkdir -p /var/www/acme
~/.acme.sh/acme.sh --issue -d your_domain.com --webroot /var/www/acme

#或者 后面的端口号随意,确保防火墙打开的
~/.acme.sh/acme.sh --issue -d your_domain.com --standalone --httpport 8181   

nginx
nginx
许可协议:  CC BY 4.0
分享

相关文章

8月 23, 2025

nginx + acme 不占用80端口申请证书

1.在你的域名conf里配置如下 server { listen 80; listen [::]:80; server_name your_domain.com; # ← 改为你的域名或IP location ^~ /.well-known/acme-challen

10月 30, 2024

nginx设置多个允许跨域的请求源

# 定义允许的源列表 map $http_origin $cors_origin { "https://youdomian.com" "https://youdomian.com"; "http://localhost:3010" "http://localhost:3010"; }

4月 2, 2024

已安装的nginx,动态模块开启google brotli 压缩,并在vite项目中启用

1.下载ngx_brotli 到github https://github.com/google/ngx_brotli 然后git clone cd /usr/local/ git clone https://github.com/google/ngx_brotli.git cd /usr/loca

下一篇

免费CDN 阿里云ESA 加速国内网站

上一篇

Cursor IDE中开发IOS应用——支持热更新

最近更新

  • ios18 swiftUI 开发的一些问题
  • Cursor IDE中开发IOS应用——支持热更新
  • nginx + acme 不占用80端口申请证书
  • 免费CDN 阿里云ESA 加速国内网站
  • nextjs15使用ai sdk的一些问题

热门标签

nginx acme 强制跳转HTTPS nodejs 代理 mac 神器 vue3 工具 docker

目录

©2025 sunday. 保留部分权利。

使用 Halo 主题 Chirpy