itsjunetime / smserver

An app to allow Jailbroken iPhones to send texts & attachments from their browser
GNU General Public License v3.0
157 stars 26 forks source link

Using Traefik as reverse proxy #117

Closed eriksmets closed 3 years ago

eriksmets commented 3 years ago

In case someone else needs this, I am using the following additional file setup with Traefik 2.4.7.

SMServer is on the LAN without SSL or Authentication. WebSocket Proxy Compatibility is set to /socket

YAML:

  routers:
    sms:
      entryPoints:
      - websecure
      service: sms
      rule: Host(`sms.mydomain.tld`) 
      tls: {}
      priority: 0
    smssocket:
      entryPoints:
      - websecure
      middlewares:
      - removesocketprefix
      - addheaders
      service: smssocket
      rule: (Host(`sms.mydomain.tld`) && PathPrefix(`/socket`))
      tls: {}
      priority: 900
  services:
    sms:
      loadBalancer:
        servers:
          - url: "http://SMSERVER_IP_ADDRESS:8471/"
    smssocket:
      loadBalancer:
        servers:
          - url: "http://SMSERVER_IP_ADDRESS:8470/"
  middlewares:
    removesocketprefix:
      stripPrefix:
        prefixes: 
        - "/socket"
    addheaders:
      headers:
        customRequestHeaders:
          X-Forwarded-Proto: "https"
itsjunetime commented 3 years ago

Thanks for adding this! I'll close this issue and add a link to it in the FAQ.