Deploy Sanic server next to NginxPermission denied (publickey) when deploying heroku code. fatal: The remote end hung up unexpectedlyNode.js + Nginx - What now?NGINX => serve several applications on a single host name with sub-urisNginx + Express + Socket.IO workaroundsNginx TCP forwarding based on hostnameNGINX as a WebSocket Proxy with DockerDeploying Sanic RawHow to deploy laravel backend with nginx?Nginx configuration to handle two SPAaxios ECONNREFUSED when requesting in a docker-compose service behind nginx reverse proxy
what organs or modifications would be needed to have hairy fish?
If a spaceship ran out of fuel somewhere in space between Earth and Mars, does it slowly drift off to the Sun?
Can you trip a breaker from a different circuit?
How to realistically describe pain?
Why would an airline put 15 passengers at once on standby?
Why aren't faces sharp in my f/1.8 portraits even though I'm carefully using center-point autofocus?
An impressive body of work
Why does my browser attempt to download pages from http://clhs.lisp.se instead of viewing them normally?
Why isn't there armor to protect from spells in the Potterverse?
Is there an equivalent of cash transportation in air cargo?
What can Thomas Cook customers who have not yet departed do now it has stopped operating?
is there a relationship between prime numbers and music?
How do my husband and I get over our fear of having another difficult baby?
What happens to a net with the Returning Weapon artificer infusion after it hits?
Smallest number containing the first 11 primes as sub-strings
Windows 10 deletes lots of tiny files super slowly. Anything that can be done to speed it up?
Where to find the Arxiv endorsement code?
Why does Captain Marvel in the MCU not have her sash?
How deep is the liquid in a half-full hemisphere?
As a new instructor, what should I consider when deciding whether to delay an exam?
What makes learning more difficult as we age?
What in my code changed between MacTeX 2017 and MacTex 2019?
MaxDetect speed
One-digit products in a row of numbers
Deploy Sanic server next to Nginx
Permission denied (publickey) when deploying heroku code. fatal: The remote end hung up unexpectedlyNode.js + Nginx - What now?NGINX => serve several applications on a single host name with sub-urisNginx + Express + Socket.IO workaroundsNginx TCP forwarding based on hostnameNGINX as a WebSocket Proxy with DockerDeploying Sanic RawHow to deploy laravel backend with nginx?Nginx configuration to handle two SPAaxios ECONNREFUSED when requesting in a docker-compose service behind nginx reverse proxy
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to deploy a Sanic app next to Nginx. I want Nginx to handle:
- File serving (my SPA and other assets)
- Certbot/letsencrypt ssl (can do without)
And I want Sanic to handle my API endpoints.
I know how to handle each separately. However, I don't know how to make them run next to each other. As far as I know, you can't have two services listening on the same TCP port. If that's the case, should I just make Nginx act as a reverse proxy to Sanic? If so, how would you go about it?
Any guidance would be appreciated.
nginx deployment sanic
add a comment
|
I'm trying to deploy a Sanic app next to Nginx. I want Nginx to handle:
- File serving (my SPA and other assets)
- Certbot/letsencrypt ssl (can do without)
And I want Sanic to handle my API endpoints.
I know how to handle each separately. However, I don't know how to make them run next to each other. As far as I know, you can't have two services listening on the same TCP port. If that's the case, should I just make Nginx act as a reverse proxy to Sanic? If so, how would you go about it?
Any guidance would be appreciated.
nginx deployment sanic
2
Even it's inside docker, this example shows overall principles of how to setup sanic behind nginx github.com/itielshwartz/sanic-nginx-docker-example.
– Fian
Mar 29 at 7:36
add a comment
|
I'm trying to deploy a Sanic app next to Nginx. I want Nginx to handle:
- File serving (my SPA and other assets)
- Certbot/letsencrypt ssl (can do without)
And I want Sanic to handle my API endpoints.
I know how to handle each separately. However, I don't know how to make them run next to each other. As far as I know, you can't have two services listening on the same TCP port. If that's the case, should I just make Nginx act as a reverse proxy to Sanic? If so, how would you go about it?
Any guidance would be appreciated.
nginx deployment sanic
I'm trying to deploy a Sanic app next to Nginx. I want Nginx to handle:
- File serving (my SPA and other assets)
- Certbot/letsencrypt ssl (can do without)
And I want Sanic to handle my API endpoints.
I know how to handle each separately. However, I don't know how to make them run next to each other. As far as I know, you can't have two services listening on the same TCP port. If that's the case, should I just make Nginx act as a reverse proxy to Sanic? If so, how would you go about it?
Any guidance would be appreciated.
nginx deployment sanic
nginx deployment sanic
asked Mar 28 at 19:02
Charming RobotCharming Robot
6471 gold badge3 silver badges18 bronze badges
6471 gold badge3 silver badges18 bronze badges
2
Even it's inside docker, this example shows overall principles of how to setup sanic behind nginx github.com/itielshwartz/sanic-nginx-docker-example.
– Fian
Mar 29 at 7:36
add a comment
|
2
Even it's inside docker, this example shows overall principles of how to setup sanic behind nginx github.com/itielshwartz/sanic-nginx-docker-example.
– Fian
Mar 29 at 7:36
2
2
Even it's inside docker, this example shows overall principles of how to setup sanic behind nginx github.com/itielshwartz/sanic-nginx-docker-example.
– Fian
Mar 29 at 7:36
Even it's inside docker, this example shows overall principles of how to setup sanic behind nginx github.com/itielshwartz/sanic-nginx-docker-example.
– Fian
Mar 29 at 7:36
add a comment
|
1 Answer
1
active
oldest
votes
This is my preferred way to run Sanic, behind nginx as you described. Then just proxy to Sanic which is listening on some other port.
server
...
location /api/
proxy_pass http://sanic-app:1234/;
1
Thanks, that's exactly what I went for
– Charming Robot
Apr 29 at 19:52
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55405089%2fdeploy-sanic-server-next-to-nginx%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is my preferred way to run Sanic, behind nginx as you described. Then just proxy to Sanic which is listening on some other port.
server
...
location /api/
proxy_pass http://sanic-app:1234/;
1
Thanks, that's exactly what I went for
– Charming Robot
Apr 29 at 19:52
add a comment
|
This is my preferred way to run Sanic, behind nginx as you described. Then just proxy to Sanic which is listening on some other port.
server
...
location /api/
proxy_pass http://sanic-app:1234/;
1
Thanks, that's exactly what I went for
– Charming Robot
Apr 29 at 19:52
add a comment
|
This is my preferred way to run Sanic, behind nginx as you described. Then just proxy to Sanic which is listening on some other port.
server
...
location /api/
proxy_pass http://sanic-app:1234/;
This is my preferred way to run Sanic, behind nginx as you described. Then just proxy to Sanic which is listening on some other port.
server
...
location /api/
proxy_pass http://sanic-app:1234/;
answered Apr 29 at 19:49
The BrewmasterThe Brewmaster
4,2254 gold badges26 silver badges42 bronze badges
4,2254 gold badges26 silver badges42 bronze badges
1
Thanks, that's exactly what I went for
– Charming Robot
Apr 29 at 19:52
add a comment
|
1
Thanks, that's exactly what I went for
– Charming Robot
Apr 29 at 19:52
1
1
Thanks, that's exactly what I went for
– Charming Robot
Apr 29 at 19:52
Thanks, that's exactly what I went for
– Charming Robot
Apr 29 at 19:52
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55405089%2fdeploy-sanic-server-next-to-nginx%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Even it's inside docker, this example shows overall principles of how to setup sanic behind nginx github.com/itielshwartz/sanic-nginx-docker-example.
– Fian
Mar 29 at 7:36