~britco/nginx/master

« back to all changes in this revision

Viewing changes to debian/help/examples/virtual_hosts

  • Committer: Bazaar Package Importer
  • Author(s): Kartik Mistry, Kartik Mistry, Michael Lustfield
  • Date: 2010-11-27 21:04:02 UTC
  • mfrom: (1.3.8 upstream)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: james.westby@ubuntu.com-20101127210402-14sgjpe6r3jup8a9
Tags: 0.8.53-1
[Kartik Mistry]
* debian/control:
  + Added Michael Lustfield as co-maintainer
* nginx.conf:
  + No need to use regex in gzip_disable for msie6, Thanks to António P. P.
    Almeida <appa@perusio.net> (Closes: #592147)
* conf/sites-available/default:
  + Fixed typo for "include fastcgi", Thanks to Mostafa Ghadamyari
    <nginx@gigfa.com> (Closes: #593142, #593143)
* debian/patches/fix_reloading_ipv6.diff:
  + Removed, merged upstream
* debian/init.d:
  + Added fix to control nginx by user in a simple way by setting DAEMON
    variable to an invalid name in /etc/default/nginx. Patch by Toni Mueller
    <support@oeko.net> (Closes: #594598)
* debian/NEWS.Debian:
  + Updated news for 0.8.x as stable branch

[Michael Lustfield]
* New upstream release (Closes: #602970)
  + 0.8.x branch is declared stable by upstream now
* Add a UFW profile set:
  + debian/nginx.ufw.profile: Added.
  + debian/control: nginx: Suggests ufw.
  + debian/dirs: Add 'etc/ufw/applications.d'
  + debian/rules: Add install rule for the nginx UFW profile.
* Moved debian/dirs to debian/nginx.dirs
* Added types_hash_max_size to nginx.conf
* Install simple default index.html file (Closes: #581416)
  + debian/dirs: Add 'usr/share/nginx/www'.
  + debian/nginx.install: Add 'html/* usr/share/nginx/www'.
* debian/patches/nginx-echo.diff:
  + Added Echo module
* Added files for nginx.docs
  - /usr/share/doc/nginx/
    + debian/help/docs/fcgiwrap
    + debian/help/docs/php
    + debian/help/docs/support-irc
    + debian/help/docs/upstream
* Added files for nginx.examples
  - /usr/share/doc/nginx/examples/
    + debian/help/docs/drupal
    + debian/help/docs/http
    + debian/help/docs/mail
    + debian/help/docs/mailman
    + debian/help/docs/nginx.conf
    + debian/help/docs/virtual_hosts
    + debian/help/docs/wordpress
* debian/conf/:
  + Removed excess spaces
  + Added tabs where appropriate
  + Added SCRIPT_FILENAME to fastcgi_params

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
##
 
2
#  File:
 
3
#    virtual_hosts
 
4
#  Description:
 
5
#    This file is meant to deliver a basic understanding of server blocks.
 
6
##
 
7
 
 
8
##
 
9
# You should look at the following URL's in order to grasp a solid understanding
 
10
# of Nginx configuration files in order to fully unleash the power of Nginx.
 
11
# http://wiki.nginx.org/Pitfalls
 
12
# http://wiki.nginx.org/Configuration
 
13
##
 
14
 
 
15
##
 
16
# Every "virtual host" that you serve will need to be in its own server block.
 
17
#
 
18
# server {
 
19
#       ...
 
20
# }
 
21
#
 
22
# After reading this file, you should understand the structure of server blocks
 
23
# and be able to understand how to modify them to your needs.
 
24
##
 
25
 
 
26
server {
 
27
 
 
28
        # The listen directive is only needed if this server block:
 
29
        #   needs to listen for IPv6
 
30
        #   needs to listen on another port
 
31
        # If you need to listen for IPv6 then both of the following lines can
 
32
        # be included.
 
33
        # DO NOT listen for both SSL and non-SSL in the same server block.
 
34
        #listen 80; ## listen for ipv4; this line is default and implied
 
35
        #listen [::]:80 default ipv6only=on; ## listen for ipv6
 
36
 
 
37
        # root specifies the document root for the requests
 
38
        root /usr/share/nginx/www;
 
39
 
 
40
        # index specifies the list of files (in order) to be tried in the event
 
41
        # no file is requested in the URI.
 
42
        index index.html index.htm;
 
43
 
 
44
        # Make site accessible from http://localhost/
 
45
        server_name localhost;
 
46
 
 
47
        # Unless you run everything as a proxy, you will want to have a root
 
48
        # location block. This example controls how files are requested.
 
49
        location / {
 
50
                # First attempt to serve request as file, then as directory,
 
51
                # then fall back to index.html. /index.html would normally be
 
52
                # front end controller pattern for handling "clean url's" in
 
53
                # a CMS such as Drupal or Wordpress.
 
54
                try_files $uri $uri/ /index.html;
 
55
        }
 
56
 
 
57
        # This location block would server any requests for /doc as well
 
58
        # as anything below it.
 
59
        location /doc {
 
60
                # root changes the root directory for these requests
 
61
                root /usr/share;
 
62
                # autoindex on allows these request to display directory listings
 
63
                # if a directory was requested
 
64
                autoindex on;
 
65
                # We'll allow these requests for localhost
 
66
                allow 127.0.0.1;
 
67
                # Anyone outside is forbidden
 
68
                deny all;
 
69
        }
 
70
 
 
71
        # This location block would serve any requests for /images as well
 
72
        # as anything below it.
 
73
        location /images {
 
74
                # This is the same as /doc except we don't allow indexes
 
75
                root /usr/share;
 
76
                autoindex off;
 
77
                allow 127.0.0.1;
 
78
                deny all;
 
79
        }
 
80
 
 
81
        # This will serve the file 404.html in the event the request is not found.
 
82
        error_page 404 /404.html;
 
83
 
 
84
        # redirect server error pages to the static page /50x.html
 
85
        # This will hit if the server generates a 500, 502, 503, or 504 status code
 
86
        error_page 500 502 503 504 /50x.html;
 
87
 
 
88
        # This location block isn't actually needed because our root for the
 
89
        # server block is the same directory. However, this could be used to
 
90
        # have a central directory for all error html files.
 
91
        location = /50x.html {
 
92
                root /usr/share/nginx/www;
 
93
        }
 
94
 
 
95
        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
 
96
        # If you're going to proxy to Apache, then just push the whole
 
97
        # request to it. You'll generally have better performance with
 
98
        # a dedicated php listener (fastcgi: php-cgi, php-fpm).
 
99
        #location ~ \.php$ {
 
100
        #       proxy_pass http://127.0.0.1;
 
101
        #}
 
102
 
 
103
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
 
104
        # This is used for passing to php-cgi and php-fpm.
 
105
        # For more information see /usr/share/doc/nginx/examples/php
 
106
        location ~ \.php$ {
 
107
                # This is where the php socket is listening.
 
108
                fastcgi_pass 127.0.0.1:9000;
 
109
                fastcgi_index index.php;
 
110
                include fastcgi_params;
 
111
        }
 
112
 
 
113
        # deny access to .htaccess, .htpasswd, and .htgroup files
 
114
        location ~ /\.ht {
 
115
                deny all;
 
116
        }
 
117
}
 
118
 
 
119
 
 
120
# another virtual host using mix of IP-, name-, and port-based configuration
 
121
server {
 
122
        listen 8000;
 
123
        listen somename:8080;
 
124
        server_name somename alias another.alias;
 
125
        root html;
 
126
        index index.html index.htm;
 
127
 
 
128
        location / {
 
129
                try_files $uri $uri/ /index.html;
 
130
        }
 
131
}
 
132
 
 
133
 
 
134
# HTTPS server
 
135
server {
 
136
        listen 443;
 
137
        server_name localhost;
 
138
 
 
139
        root html;
 
140
        index index.html index.htm;
 
141
 
 
142
        ssl on;
 
143
        ssl_certificate cert.pem;
 
144
        ssl_certificate_key cert.key;
 
145
 
 
146
        ssl_session_timeout 5m;
 
147
 
 
148
        ssl_protocols SSLv3 TLSv1;
 
149
        ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
 
150
        ssl_prefer_server_ciphers on;
 
151
 
 
152
        location / {
 
153
                try_files $uri $uri/ /index.html;
 
154
        }
 
155
}