uwsgi

package module
v0.0.0-...-74a1008 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

caddy-uwsgi-transport

This module adds uwsgi reverse proxying support to Caddy.

ID: http.reverse_proxy.transport.uwsgi

Installation

By using xcaddy

xcaddy build \
    --with github.com/BadAimWeeb/caddy-uwsgi-transport

Usage

Caddyfile
reverse_proxy [<matcher>] [<upstreams...>] {
	transport uwsgi {
    uwsgi_param <key> <value> # in case you need to set uwsgi params (for example UWSGI_SCRIPT)
  }
}
JSON
{
  "apps": {
    "http": {
      "servers": {
        "": {
          "routes": [
            {
              "handle": [
                {
                  "handler": "reverse_proxy",
                  "transport": {
                    "protocol": "uwsgi",
                    "uwsgi_params": {
                      "<key>": "<value>"
                    }
                  },
                  "upstreams": [{ "dial": "<upstream>" }]
                }
              ]
            }
          ]
        }
      }
    }
  }
}

This module is licensed under the Apache 2.0 License.

Copyright ©️ 2024 BadAimWeeb.
Original author copyright ©️ 2023 Xinhe Wang.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transport

type Transport struct {
	// UWSGIParams is a map of static uwsgi params to be passed to uWSGI server.
	// This is useful for example, setting UWSGI_SCRIPT (uWSGI may require this for some request) and many other params.
	UWSGIParams map[string]string `json:"uwsgi_params,omitempty"`
}

The uwsgi transport module allows you to proxy requests to an uWSGI server with uwsgi protocol.

Caddyfile syntax is supported:

```caddyfile

reverse_proxy [<matcher>] [<upstreams...>] {
	transport uwsgi {
		# in case you need to set uwsgi params (for example UWSGI_SCRIPT), add this:
		uwsgi_param <key> <value>
	}
}

```

func (Transport) CaddyModule

func (Transport) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (Transport) RoundTrip

func (t Transport) RoundTrip(req *http.Request) (*http.Response, error)

func (*Transport) UnmarshalCaddyfile

func (t *Transport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL