Skip to content
Run Caddy with your NGINX config
Go
Branch: master
Clone or download
Mohammed90 Clean up (#4)
* only return on critical irrecoverable error
* remove ineffective assignment
* use label with continue
Latest commit 00e0ae2 Feb 14, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
directives add usage steps of nginx-dirs.go Feb 9, 2020
testdata Initial commit Oct 28, 2019
.golangci.yml
LICENSE.txt Initial commit Oct 28, 2019
README.md Clean up go.mod and update links in readme Feb 9, 2020
go.mod Clean up go.mod and update links in readme Feb 9, 2020
go.sum Clean up go.mod and update links in readme Feb 9, 2020
if.go
lexer.go Clean up (#4) Feb 14, 2020
location.go Clean up (#4) Feb 14, 2020
nginxadapter.go
parse.go add support for more of the common directives Feb 7, 2020
processors.go add support for more of the common directives Feb 7, 2020
server.go Clean up (#4) Feb 14, 2020
upstream.go add support for more of the common directives Feb 7, 2020

README.md

Caddy NGINX Config Adapter

This is a config adapter for Caddy which converts NGINX config files into Caddy's native format.

This project is not complete, and we are asking the community to help finish its development. Due to resource constraints, we are unable to do all the development on our own at this time. However, we hope you will pick it up and collaborate on it together as a community. We'll be happy to coordinate efforts from the community. Start by opening issues and pull requests, then reviewing pull requests and testing changes!

Currently supported directives per context:

  • main:
    • http
  • http:
    • server
  • server:
    • listen
    • server_name
    • location
    • root
    • access_log
    • rewrite
    • if
  • if:
    • break
    • return
    • rewrite
    • set
  • upstream:
    • server
    • hash
    • ip_hash
    • keepalive
    • keepalive_requests
    • keepalive_timeout
    • ntlm
    • least_conn
    • random
  • location:
    • location
    • if
    • root
    • add_header
    • deny
    • allow
    • rewrite
    • fastcgi_pass
    • proxy_pass
    • expires
    • return
  • if (in location):
    • root
    • gzip
    • add_header
    • expires
    • proxy_pass

Thank you, and we hope you have fun with it!

Install

Note: This module is only compatible with Caddy 2, which is currently in beta.

First, go get this module:

$ go get github.com/caddyserver/nginx-adapter

To compile, simply go build Caddy 2 with this adapter plugged in. Add this to the list of imports:

	_ "github.com/caddyserver/nginx-adapter"

Then run:

$ go build

Use

Using this config adapter is the same as all the other config adapters.

You can also run Caddy directly with an nginx config using caddy run|start --config nginx.conf --adapter nginx (however, we do not recommend this until the config adapter is completed).

Disclaimer

This project is not affiliated with F5 Networks or NGINX, Inc. NGINX is a registered trademark of NGINX, Inc.

You can’t perform that action at this time.