summaryrefslogtreecommitdiff
path: root/etc/examples/httpd.conf
blob: c26d4ce535334b8fb1ea82b88ff6415ef08d407f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# $OpenBSD: httpd.conf,v 1.17 2017/04/16 08:50:49 ajacoutot Exp $

#
# Macros
#
ext_addr="*"

#
# Global Options
#
# prefork 3

#
# Servers
#

# A minimal default server
server "default" {
	listen on $ext_addr port 80
}

# A name-based "virtual" server on the same address
server "www.example.com" {
	listen on $ext_addr port 80

	# Logging is enabled by default, but it can be turned off per server
	#no log

	location "/pub/*" {
		directory auto index
		log style combined
	}

	location "*.php" {
		fastcgi socket "/run/php-fpm.sock"
	}

	location "/cgi-bin/*" {
		fastcgi

		# The /cgi-bin directory is outside of the document root
		root "/"
	}

	root "/htdocs/www.example.com"
}

# An HTTPS server using SSL/TLS
server "secure.example.com" {
	listen on 127.0.0.1 tls port 443

	# TLS certificate and key files created with acme-client(1)             
	tls certificate "/etc/ssl/example.com.fullchain.pem"
	tls key "/etc/ssl/private/example.com.key"

	# Define server-specific log files relative to /logs
	log { access "secure-access.log", error "secure-error.log" }

	# Increase connection limits to extend the lifetime
	connection { max requests 500, timeout 3600 }

	root "/htdocs/secure.example.com"
}

# Another server on a different internal IPv4 address
server "intranet.example.com" {
	listen on 10.0.0.1 port 80
	directory { auto index, index "default.htm" }
	root "/htdocs/intranet.example.com"
}

# An IPv6-based server on a non-standard port
server "ipv6.example.com" {
	listen on 2001:db8::53f6:3eab port 81
	root "/htdocs/ipv6.example.com"
}

# Include MIME types instead of the built-in ones
types {
	include "/usr/share/misc/mime.types"
}