Skip to content

Commit

Permalink
fix: nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
zdm committed Jan 1, 2024
1 parent 694ef84 commit f15c50b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
16 changes: 0 additions & 16 deletions lib/app/components/nginx/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,6 @@ export default class extends Component {
return new Nginx( this.app, this.config );
}

async _init () {
if ( this.instance.acmeChallengesUrl && this.app.privateHttpServer ) {
this.app.privateHttpServer.head( this.instance.acmeChallengesUrl + "/test", req => {
req.end( {
"status": 200,

"headers": {
"x-acme-test": req.headers.get( "x-acme-test" ),
},
} );
} );
}

return result( 200 );
}

async _afterAppStarted () {
return this.instance.start();
}
Expand Down
6 changes: 6 additions & 0 deletions lib/app/components/nginx/resources/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ http {

proxy_pass "http://<%- privateHrrpServerUpstream %>";
}

location /.well-known/acme-challenge/test {
add_header X-ACME-Test $http_x_acme_test;

return 200;
}
<% } -%>
}

Expand Down
6 changes: 6 additions & 0 deletions lib/app/components/nginx/resources/server.http.nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,11 @@ server {

proxy_pass "http://<%- privateHrrpServerUpstream %>";
}

location /.well-known/acme-challenge/test {
add_header X-ACME-Test $http_x_acme_test;

return 200;
}
<% } -%>
}

0 comments on commit f15c50b

Please sign in to comment.