Introduced common_location_shared() to check if location sharing is always,
[quix0rs-gnu-social.git] / nginx.conf.sample
1 server {
2   listen 80;
3   listen [::]:80;
4
5   # FIXME: change domain name here (and also make sure you do the same in the next 'server' section)
6   server_name social.example.org;
7
8   # redirect all traffic to HTTPS
9   rewrite ^ https://$server_name$request_uri? permanent;
10 }
11
12 server {
13   # Use HTTPS. Seriously. Set it up with a cert (any cert) before you run the install.
14   listen 443 ssl;
15
16   # Server name
17   # Change "social.example.org" to your site's domain name
18   server_name social.example.org;
19
20   # SSL
21   # Uncomment and change the paths to setup
22   # your SSL key/cert. See https://cipherli.st/
23   # for more information
24   ssl_certificate       ssl/certs/social.example.org.crt;
25   ssl_certificate_key   ssl/private/social.example.org.key;
26
27   # Logs
28   # Uncomment and change the paths to setup
29   # logging
30   #access_log /path/to/access.log;
31   #error_log  /path/to/error.log;
32
33   # Root
34   # Change the path below to where you installed
35   # GNU social
36   root /path/to/gnusocial/root;
37
38   # Index
39   index index.php;
40
41   # PHP
42   location ~ \.php {
43     include snippets/fastcgi-php.conf;
44
45     # This should be the same value as in your (optional) /etc/php5/fpm/pool.d/$server.conf
46     fastcgi_pass unix:/var/run/php5-fpm.sock;
47
48     # Remove the "fastcgi_pass" line above and uncomment
49     # the one below to use TCP sockets instead of Unix sockets
50     #fastcgi_pass 127.0.0.1:9000;
51   }
52
53   # Location
54   location / {
55     try_files $uri $uri/ @gnusocial;
56   }
57
58   # Fancy URLs
59   location @gnusocial {
60     rewrite ^(.*)$ /index.php?p=$1 last;
61   }
62
63   # Restrict access that is unnecessary anyway
64   location ~ /\.(ht|git) {
65     deny all;
66   }
67 }
68