A reproducible example for an issue I'm encoutering when deploying my gunicorn app to nginx

Ngnix Issue

This is a minimum, reproducible example for an issue I'm encoutering when deploying my gunicorn app to nginx.

Installation (Linux)

Webserver

in the /webserver directory, create a Python virtual environment python3 -m venv venv and activate it source venv/bin/activate then install all requirements from the requirements.txt file pip install -r requirements.txt

Make sure nginx is installed on your machine. Copy the webserver_nginx_conf file to /etc/nginx/sites-available directory. Then establish the symbolic link sudo ln -s /etc/nginx/sites-available/myproject /etc/nginx/sites-enabled. Perform the test command sudo nginx -t and then sudo systemctl restart nginx

Running without Nginx

Webserver:

(venv) /webserver$ gunicorn --worker-class gevent --workers 1 --timeout=160 --bind 0.0.0.0:5000 webserver:app

Go-Server:

/goserver$ go run main.go

When visiting http://localhost:5000 you should notice in the browser console that data is coming in and is being properly parsed.

Running with Nginx

Make sure Nginx is running Webserver:

(venv) /webserver$ gunicorn --worker-class gevent --workers 1 --timeout=160 --bind 0.0.0.0:5000 webserver:app

Go-Server:

/goserver$ go run main.go

Now when checking browser console, some responses should get truncated.

Owner
Space Simulation Services of Canada Corporation
Space Simulation Services of Canada Corporation
Similar Resources

Concurrency Lab 1 Go Example

Concurrency Lab 1 Go Example

Concurrency Lab 1 If you're stuck look at examples on Go by Example Using the lab sheet There are two ways to use the lab sheet, you can either: creat

Oct 11, 2021

Concurrency Lab 2 Go Example

Concurrency Lab 2 Go Example

Concurrency Lab 2 If you're stuck look at examples on Go by Example Using the lab sheet There are two ways to use the lab sheet, you can either: creat

Oct 12, 2021

An example event-driven application using Atmo and NATS

Atmo + NATS Example Project This repo is an example of using Atmo with NATS as a streaming messaging layer. In this example, Atmo connects to NATS and

Oct 27, 2021

Example hello-world service uses go-fx-grpc-starter boilerplate code

About Example hello-world service uses https://github.com/srlk/go-fx-grpc-starter boilerplate code. Implementation A hello world grpc service is creat

Nov 14, 2021

Go clean architecture fully working example

Burp - clean architecture app Burp is a CRUD app managing beers. Front-end is written in Angular 12. Database in this example is mongodb. Root project

Nov 27, 2022

Simple example program using CRUD operations to interface with azcosmos

Simple example program using CRUD operations to interface with azcosmos

Nov 15, 2021

Example of using advanced gRPC error model

grpcerrors Example of using advanced gRPC error model

Nov 19, 2021

Example showing how to implement a basic mutating webhook

Kubernetes Mutating Webhook example This shows a basic implementation of a mutating webhook. Setup Note: This relies on TLS certificates to function c

Sep 8, 2022

Example ReSTFul Server in Golang - SBU-Snapp-School

students.go Introduction ReSTful API to create, update, retrieve and delete students from a datastore. Requests needs validation, package needs tests,

Sep 14, 2022
Issue Reaction Counter with golang

Below is the title and reaction count for issues filed in this repository

Oct 26, 2022
dockerized (postgres + nginx + golang + react)
dockerized (postgres + nginx + golang + react)

PNGR Stack Dockerized (postgres + nginx + golang + react) starter kit Only implements basic user signup, session management, and a toy post type to de

Jan 7, 2023
This example implements a basic example of how to create your own modules, and how to call them from other modules

This example implements a basic example of how to create your own modules, and how to call them from other modules. In addition, an example of how to do unit tests is developed.

Feb 1, 2022
Minimal example app of hexagonal architecture in go

Hexagonal Architecture Minimal example of hexagonal architecture (ports & adapters) in go. Resources T

Nov 5, 2021
Example app using labstack/echo and ozzo-validator.

Example app using labstack/echo and ozzo-validator.

Oct 17, 2022
Example programs for the Gio project.

Gio Examples Example programs for the Gio project. Issues File bugs and TODOs through the issue tracker or send an email to ~eliasnaur/[email protected].

Dec 20, 2022
An example client implementation written in GO to access the CyberVox platform API

About This is an example client implementation written in GO to access the CyberVox platform API.

Nov 7, 2022
This is an example of the cobra project

Devops cmd and mian.go This is an example of the cobra project Execute the following command in the current path to compile the project,you will appea

Sep 6, 2022
Example blog built with Go and the Cosmic Headless CMS 🔥
Example blog built with Go and the Cosmic Headless CMS 🔥

Go + Cosmic This repo contains an example blog starter that is built with Go, and Cosmic. See live demo hosted on Heroku Prerequisites Go (I recommend

May 8, 2022
this is an example of hystrix-go usage in web dev

hystrix-go-example this is an example of hystrix-go usage in web dev Explanation this example contains 2 service: alpha as our main service, circuit b

Apr 22, 2022