Here Pawan Kumar will explain how to Flask App Deployment on Windows VPS using IIS Reverse Proxy & GoDaddy DNS
Flask App Deployment on Windows VPS using IIS
Complete Step-by-Step Guide for Deploying Python Flask Application using GoDaddy DNS + IIS Reverse Proxy + HTTPS SSL
Python Flask IIS Windows VPS GoDaddy DNS HTTPS SSL
Final Architecture
Internet
↓
yourdomain.com / app.yourdomain.com
↓
GoDaddy DNS
↓
Windows VPS Public IP
↓
IIS (Port 80 / 443)
↓
Reverse Proxy
↓
Flask App (127.0.0.1:5000)
Ensure your Flask app is already running on:
Test locally on VPS browser:
Open:
https://whatismyipaddress.com
Example Public IP:
Main Domain Example
| Type |
Name |
Value |
| A |
@ |
43.xx.xx.xx |
Subdomain Example
| Type |
Name |
Value |
| A |
app |
43.xx.xx.xx |
- Open Server Manager
- Add Roles and Features
- Install Web Server (IIS)
- Enable IIS Management Console
https://www.iis.net/downloads/microsoft/url-rewrite
https://www.iis.net/downloads/microsoft/application-request-routing
- Open IIS Manager
- Click Server Name
- Open ARR Cache
- Open Server Proxy Settings
- Enable Proxy
| Field |
Value |
| Site Name |
FlaskApp |
| Physical Path |
C:\inetpub\flaskapp |
| Binding |
http |
| Port |
80 |
| Host Name |
app.yourdomain.com |
Create web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://127.0.0.1:5000/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
| Port |
Purpose |
| 80 |
HTTP |
| 443 |
HTTPS |
| 5000 |
Internal Flask App |
Install Waitress:
Example app.py:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def home():
return "Flask Running via IIS"
if __name__ == "__main__":
from waitress import serve
serve(app, host="127.0.0.1", port=5000)
Download Win-ACME:
https://www.win-acme.com/
Run:
Download NSSM:
Create Windows Service:
Start Service:
- Do NOT expose Flask directly publicly using 0.0.0.0
- Use IIS Reverse Proxy for internet traffic
- Use HTTPS SSL for production
- Use separate ports for multiple Flask apps
- Use Windows Service for automatic startup
| Subdomain |
Port |
| api.domain.com |
5000 |
| trade.domain.com |
5001 |
| admin.domain.com |
5002 |
Flask + IIS Deployment Guide for Windows VPS