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!
Note: This module is only compatible with Caddy 2, which is currently in beta.
First, the xcaddy command:
$ go get -u github.com/caddyserver/xcaddy/cmd/xcaddy
Use the command in the following format:
$ xcaddy build <version>
[--output <file>]
[--with <module[@version]>...]
For example:
$ xcaddy build v2.0.0-beta.20 \
--with github.com/caddyserver/nginx-adapter@580d27d4d7cb0351b3f25cc9e79850344782afcf
Using this config adapter is the same as all the other config adapters.
- Learn about config adapters in the Caddy docs
- You can adapt your config with the
adapt
command
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).
This project is not affiliated with F5 Networks or NGINX, Inc. NGINX is a registered trademark of NGINX, Inc.