Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update nginx file to remove ruby erb #217

Merged
merged 1 commit into from
May 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions public/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
worker_processes 1;
daemon off;

error_log <%= ENV["APP_ROOT"] %>/nginx/logs/error.log;
error_log ((APP_ROOT))/nginx/logs/error.log;
events { worker_connections 1024; }

http {
charset utf-8;
log_format cloudfoundry '$http_x_forwarded_for - $http_referer - [$time_local] "$request" $status $body_bytes_sent';
access_log <%= ENV["APP_ROOT"] %>/nginx/logs/access.log cloudfoundry;
access_log ((APP_ROOT))/nginx/logs/access.log cloudfoundry;
default_type application/octet-stream;
include mime.types;
sendfile on;
Expand All @@ -31,25 +31,13 @@ http {
server_tokens off;

server {
listen <%= ENV["PORT"] %>;
listen ((PORT));
server_name localhost;
add_header X-Frame-Options SAMEORIGIN;

location / {
root <%= ENV["APP_ROOT"] %>/public;
root ((APP_ROOT))/public;
index index.html index.htm Default.htm;
<% if ENV["FORCE_HTTPS"] %>
if ($http_x_forwarded_proto != "https") {
return 301 https://$host$request_uri;
}
<% end %>
}

<% unless File.exists?(File.join(ENV["APP_ROOT"], "nginx/conf/.enable_dotfiles")) %>
location ~ /\. {
deny all;
return 404;
}
<% end %>
}
}