-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #740 from heroku/nginx-mime-updates
Nginx MIME type updates
- Loading branch information
Showing
9 changed files
with
61 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# this file is separate from mime.types to allow easier syncing with upstream | ||
types { | ||
# mime.types still defines "application/javascript" for "js" | ||
# We only define "mjs" here to avoid duplicate extension warnings on startup. | ||
# In compliance with RFC 9239, we are using "text/javascript" for "mjs" | ||
# If and when upsteam ever update their default config, we can drop this. | ||
# Also see https://trac.nginx.org/nginx/ticket/2216 | ||
text/javascript mjs; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,44 @@ | ||
require_relative "spec_helper" | ||
|
||
describe "A PHP application" do | ||
it "installs a recent stable nginx with OpenSSL support and expected modules" do | ||
new_app_with_stack_and_platrepo('test/fixtures/default').deploy do |app| | ||
nginx = app.output.match(/- nginx \((\d+\.\d*[02468]\.\d+)/) | ||
expect(nginx).not_to be_nil, "expected nginx install line in build output" | ||
expect(Gem::Dependency.new('nginx', '~> 1.14').match?('nginx', nginx[1])).to be == true, "expected nginx version compatible with selector '~> 1.14' but got #{nginx[1]}" | ||
retry_until retry: 3, sleep: 5 do | ||
nginx_v = app.run('nginx -V') | ||
expect(nginx_v).to match(/^built with OpenSSL/) | ||
expect(nginx_v).to match(/--with-http_auth_request_module/) | ||
expect(nginx_v).to match(/--with-http_realip_module/) | ||
expect(nginx_v).to match(/--with-http_ssl_module/) | ||
expect(nginx_v).to match(/--with-http_stub_status_module/) | ||
end | ||
end | ||
end | ||
it "allows access to /.well-known/ with Nginx" do | ||
new_app_with_stack_and_platrepo('test/fixtures/default').tap do |app| | ||
describe "A PHP application using Nginx" do | ||
before(:all) do | ||
@app = new_app_with_stack_and_platrepo('test/fixtures/default').tap do |app| | ||
app.before_deploy(:append) do | ||
FileUtils.mkdir_p(".well-known/acme") | ||
File.open(".well-known/acme/foo", "w+") do |f| | ||
f.write 'bar' | ||
end | ||
File.open("Procfile", "w+") do |f| | ||
f.write 'web: heroku-php-nginx' | ||
end | ||
end | ||
app.deploy do |app| | ||
expect(successful_body(app, path: '/.well-known/acme/foo')).to eq 'bar' | ||
File.write(".well-known/acme/foo", "bar") | ||
|
||
FileUtils.touch("test.mjs") | ||
|
||
File.write("Procfile", "web: heroku-php-nginx") | ||
end | ||
end | ||
|
||
@app.deploy | ||
end | ||
|
||
after(:all) do | ||
@app.teardown! | ||
end | ||
|
||
it "gets a recent stable Nginx with OpenSSL support and expected modules" do | ||
nginx = @app.output.match(/- nginx \((\d+\.\d*[02468]\.\d+)/) | ||
expect(nginx).not_to be_nil, "expected nginx install line in build output" | ||
expect(Gem::Dependency.new('nginx', '~> 1.14').match?('nginx', nginx[1])).to be == true, "expected nginx version compatible with selector '~> 1.14' but got #{nginx[1]}" | ||
retry_until retry: 3, sleep: 5 do | ||
nginx_v = @app.run('nginx -V') | ||
expect(nginx_v).to match(/^built with OpenSSL/) | ||
expect(nginx_v).to match(/--with-http_auth_request_module/) | ||
expect(nginx_v).to match(/--with-http_realip_module/) | ||
expect(nginx_v).to match(/--with-http_ssl_module/) | ||
expect(nginx_v).to match(/--with-http_stub_status_module/) | ||
end | ||
end | ||
|
||
it "allows access to /.well-known/" do | ||
expect(successful_body(@app, path: '/.well-known/acme/foo')).to eq 'bar' | ||
end | ||
|
||
it "serves a .mjs file with MIME type text/javascript" do | ||
expect(successful_request(@app, path: '/test.mjs').get_header('Content-Type')).to eq 'text/javascript' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters