How to add multiple ip and add sub-domain in nginx?

I was following the nginx,uwsgi with flask tutorial. My nginx config file contains:

server {

listen 5000;
server_name 19X.X.X.X;

client_header_buffer_size 5M;
large_client_header_buffers 4 5M;
client_max_body_size 75M;

location / {
    include uwsgi_params;     
uwsgi_pass flask:8080;


Here I want to add and additional IP address like 123.345.67.8 and a subdomain How can I add there

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
February 15, 2022


Indeed as already mentioned, the best way to go is to use Nginx server blocks.

There is no need to add additional IP addresses.

Here is a quick step by step video on how to host multiple Docker containers with Nginx and Nginx server blocks:

Even if you are not using Docker, the concept would be the same.



Hi @somum

Here’s an article that discusses what you wish to accomplish

Understanding the concept of virtual host blocks in Nginx will help you with setting up the above and more different setups.