File: ssi-module-test

package info (click to toggle)
nginx 1.28.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,696 kB
  • sloc: ansic: 169,569; sh: 623; perl: 439; python: 240; makefile: 130; cpp: 19
file content (25 lines) | stat: -rw-r--r-- 567 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
set -e

cat <<EOF > "/etc/nginx/sites-enabled/default"
server {
  listen 80 default_server;
  root /var/www/html;

  location /loc1.html {
    add_after_body /loc2.html;
  }

  location /loc2.html {
    ssi on;
  }
}
EOF
mkdir -p /var/www/html
echo '<p>Hi from location 1 !</p>' > /var/www/html/loc1.html
echo '<p>Hi from location 2 on <!--#echo var="host" --> !</p>' > /var/www/html/loc2.html

nginx -t
invoke-rc.d nginx restart || { journalctl -n all -xu nginx.service; exit 1; }

curl --fail -w "response_code: %{http_code}\n" http://127.0.0.1/loc1.html