# Automatic Port Assingment

**URL:** <https://forums.suse.com/t/automatic-port-assingment/5991>\
**Category:** General\
**Created:** [March 28, 2017, 6:28am UTC](https://forums.suse.com/t/automatic-port-assingment/5991 "2017-03-28T06:28:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guido\_Steiner](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/guido_steiner/32/5862_2.png) [@Guido\_Steiner](https://forums.suse.com/u/Guido_Steiner)\
**Post date:** [March 28, 2017, 6:28am UTC](https://forums.suse.com/t/automatic-port-assingment/5991/1 "2017-03-28T06:28:19Z")

</div>

Hello,

can anyone help me to automated my stack deployment?

Currently I have a List where I write down Ports I use.

As example:

wordpress tcp 8080  
docuwiki tcp 8081  
Jira tcp 8082

then I write my reverse proxy conf for each stack:

server {  
listen 443 ssl;  
server\_name [jira.example.com](http://jira.example.com);  
resolver 172.16.16.134 valid=5s;  
ssl\_certificate /etc/nginx/certs/wildcard.crt;  
ssl\_certificate\_key /etc/nginx/certs/wildcard.key;

location / {  
proxy\_set\_header Host $host;  
proxy\_set\_header X-Forwarded-Host $host;  
proxy\_set\_header X-Forwarded-Server $host;  
proxy\_set\_header X-Forwarded-Proto $scheme;  
proxy\_set\_header X-Forwarded-Port 8090;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
set $upstream “[jira-server.jira.env.example.com:8082](http://jira-server.jira.env.example.com:8082)”;  
proxy\_pass http://$upstream;  
proxy\_http\_version 1.1;  
client\_max\_body\_size 10M;  
}

}

I realy would like to automate this. so I don’t have to make a list with used ports and don’t have to write each time config files for nginx.

Any idea how I could do this?
