Skip to content

Commit ecddd37

Browse files
Updated default Rails NGINX template to support pre-NGINX 1.25.1 SSL
1 parent bcc5929 commit ecddd37

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/rails/nginx.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def self.defaults(options)
4444
domain: domain,
4545
port: port,
4646
root_path: Rails.public_path,
47-
template_path: File.expand_path("nginx/nginx.conf.erb", __dir__),
47+
template_path: File.expand_path("nginx/templates/nginx.conf.erb", __dir__),
4848
ssl: true,
4949
log: true,
5050
ssl_certificate_path: Rails.root.join("tmp/nginx/_#{domain}.pem"),
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ server {
3737

3838
<% if options[:ssl] %>
3939
# ssl
40+
<% if nginx_version >= Ruby::Nginx::Version.new("1.25.1") %>
4041
listen 443 ssl;
4142
http2 on;
43+
<% else %>
44+
listen 443 ssl http2;
45+
<% end %>
4246
ssl_certificate <%= options[:ssl_certificate_path] %>;
4347
ssl_certificate_key <%= options[:ssl_certificate_key_path] %>;
4448
<% end %>

0 commit comments

Comments
 (0)