Skip to content

Instantly share code, notes, and snippets.

@geolaw
Created March 1, 2022 21:20

Revisions

  1. geolaw created this gist Mar 1, 2022.
    13 changes: 13 additions & 0 deletions simple_http.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    [Unit]
    Description=http redirect
    # simple web service to server a index.html with a meta refresh without having to do via apache/nginx
    [Install]
    WantedBy=multi-user.target

    [Service]
    Type=simple
    User=root # need root to bind to port 80
    WorkingDirectory=/Downloads/html/ # directory containing a index.html with a meta refresh for redirect
    ExecStart=python -m http.server 80
    StandardOutput=null # log nothing
    StandardError=null # log nothing