Skip to content

Commit

Permalink
default.conf is what we need to edit
Browse files Browse the repository at this point in the history
    podman run -p 8080:80 -v ./default.conf:/etc/nginx/conf.d/default.conf \
        quay.io/colemanx/raku-doc-website
  • Loading branch information
dontlaugh committed Feb 27, 2023
1 parent 1d9656b commit 3c537f7
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions default.conf
Expand Up @@ -3,53 +3,24 @@ server {
listen [::]:80;
server_name localhost;

#access_log /var/log/nginx/host.access.log main;

# location / {
# root /usr/share/nginx/html;
# index index.html index.htm;
# }
# rewrite html extensions
rewrite ^(/.+)\.html$ $scheme://$host$1 permanent;
rewrite ^(/.+)\.html$ $scheme://$host:$server_port$1;

This comment has been minimized.

Copy link
@dontlaugh

dontlaugh Feb 27, 2023

Author Collaborator

$server_port comes from the nginx listener config; it will never automatically match the container port mapping, e.g. -p $FOO:80


location / {
index index.html index.php;
# index index.html index.php;
# this way nginx first tries to serve the file
# as an .html although it doesn't have the extension
try_files $uri.html $uri $uri/ @handler;
root /usr/share/nginx/html;
try_files $uri.html $uri $uri/ @handler;
}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

0 comments on commit 3c537f7

Please sign in to comment.