Apache 服务器未为一个特定路径设置 Content-Type header
Apache Server not setting Content-Type header for one specific path
我有这个简单的 Apache 虚拟主机,它是唯一启用的:
<VirtualHost *:8000>
ServerName store.com
ServerAdmin admin@store.com
DocumentRoot /var/www/store/public
ErrorLog ${APACHE_LOG_DIR}/store-error.log
CustomLog ${APACHE_LOG_DIR}/store-access.log combined
ProxyPreserveHost On
ProxyRequests Off
<Proxy *>
Order Allow,Deny
Allow from all
</Proxy>
# Pass requests to puma
ProxyPass / http://127.0.0.1:8090/
ProxyPassReverse / http://127.0.0.1:8090/
</VirtualHost>
上游是 Puma 服务 运行 Ruby Rails/Spree。
当我通过 Apache (http://store.com:8000/store/) or directly through Puma (http://store.com:8090/store/) 访问商店根路径时,它对两者都非常有效。响应的Content-Type
header设置为text/html; charset=utf-8
.
当我在端口 8090 (http://store.com:8090/store/admin/orders/) 上直接通过 Puma 访问管理页面时,它也能正常工作,并向我发送这些 headers:
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Link: </assets/jquery-ui/theme.self-706610e33a9ca23fe976ec6c425ca1ef84a7b054e058b3e552b026c31182f86d.css?body=1>; rel=preload; as=style; nopush,</assets/jquery-ui/autocomplete.self-f0b810a4a7bb8c90994675d7c5bfe636d615a5785cf81cae3340aa5e6adc55ca.css?body=1>; rel=preload; as=style; nopush,</assets/select2.self-20a5067d001f14dc1171e7088048f4cdbf504eab24351837fa7238667b52eb69.css?body=1>; rel=preload; as=style; nopush,</assets/animate.self-ccd089adb225743875de4990ac63f473911699215826b255476a0bb784fe9d9c.css?body=1>; rel=preload; as=style; nopush,</assets/flatpickr.self-135130d7b1cbb1e166f6d77e122c442329cb012401226a084c5212b5a62b61c7.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend/spree_admin.self-8cbb9e055b620fd84602a8114c7cac7f0456bc074f2a0ee383153d379e79c9b0.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend.self-4984d37b1be7d78543cf464fae996bcd8e0e8a72c929b2ded5fde626869184f7.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend/all.self-33fc4a513acb9a5f3fd4ba26b89c94184e5d028c4bd40eee6736d3ccfea5c140.css?body=1>; rel=preload; as=style; nopush,</assets/modernizr.self-e2a216f830f95df2a1a5ee07c11b930e8b8023503327c46509eab917124b956b.js?body=1>; rel=preload; as=script; nopush,</assets/purify.self-2c62ea8bace8181f9a3b47a3248869cee423fe7bea458400500f4440d61e9227.js?body=1>; rel=preload; as=script; nopush,</assets/sortable.self-c9fce5f0d6c69bde788b93cf4dbaa66f9c374567ec702b91ba9cce4215036231.js?body=1>; rel=preload; as=script; nopush,</assets/flatpickr.self-ff20c31266dbe4dafc71b4ad82970c00ed83137a79c201fcb1743fa21d96a1a4.js?body=1>; rel=preload; as=script; nopush,</assets/jquery3.self-2a83d06853bd343c7bfc2e5d4539814cfa934676e2948ed348311435eca862f5.js?body=1>; rel=preload; as=script; nopush,</assets/popper.self-55bd1408b0e4ff3edf21524b78fbe2266615c8015ce0e5f0828089b1de27d63c.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/util.self-0f5e3d6a124973f023aa2dd48e39d4dae20bef128eb66edd89cad98921d5b731.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/dropdown.self-388352e554187a9ed5e38014a35052e89a39a52fcc3a38f8b273a126985d107c.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/tab.self-2bc5ce357bf6f839ac0eaebc053ee14ff7fab962a72e6e626816d2d0d9cf4ea1.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/collapse.self-819a76b712a356583f2daf0a7a43d03e870b6e12fbb0cd213504ed0a29afce57.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/modal.self-78fca8dd620c5c40de1ff1577a9671f2aa64fec856e5500a3e3988db33f2c079.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/alert.self-7910197be375fc8369715847d5176b16053a5676992d82669332fa58c7adecdb.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/button.self-4902e68356649c387d8225a760822984725a7277b1910d988a3b16e9b90286ff.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/scrollspy.self-a22b4a59e90f230257720ad55234915bfc9ce23fb39c4663505565f3851d782e.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/toast.self-cdff30d8b7acb329687f0ab252895951e15288e879d2bc7c67da241712fd4b2f.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/tooltip.self-e27ff78a3b7483ee1e081d878fde16c8ae3f2048904bf829f1f8500c3532b42a.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/carousel.self-aea44cc40d4583fb16021b37cd491d0fd75ec158082386427186a6a10b9ae762.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/popover.self-632bb01a3518dbf001a12224ea49425964dd4faa2f9cd9f50b5c65e910836d80.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap-sprockets.self-fbfa5ad7d9aa0afe439ec4ff3883acc4cb92b62cb67c40d674320c9aa1d4642d.js?body=1>; rel=preload; as=script; nopush,</assets/handlebars.self-b2608718817462056ff3eaeb15624e6538f38e38d14c0cc307fb837f506c6c7c.js?body=1>; rel=preload; as=script; nopush,</assets/cleave.self-4bfd99b74c3b284fcfb77c7af7ff322d027caf55899c0dfc47f84437cb052b61.js?body=1>; rel=preload; as=script; nopush,</assets/js.cookie.self-7c886e54899b328d9497acda8316f6bf1a1a612a83a0e14cb4d0f9aaa5004c44.js?body=1>; rel=preload; as=script; nopush,</assets/jquery.jstree/jquery.jstree.self-a709466be3723778dda397286f84ef8e16169b798037462b658b43c95bffb595.js?body=1>; rel=preload; as=script; nopush,</assets/jquery_ujs.self-784a997f6726036b1993eb2217c9cb558e1cbb801c6da88105588c56f13b466a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/version.self-c8e3d1203da26ea7efdf83c1eabb3f0ba55cb68e463f5ccf0d77bd15ce6a8e61.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/keycode.self-ad63cd20acf49dd333bbbc537454d7d475bd610eb5b88de0dca009f0c3d314b1.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/position.self-1b49c8c521e67a4a88bfdad6b4d944d33686d25009a0e40a1e170acdd7b6962a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/safe-active-element.self-a1f1a1a7dae3269ce03f6fffb2dcc9b4a7490f5d546c65d54417bec3be24b668.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/unique-id.self-66e85ac85cd0b6b8b1bb89369fc65f608f716869dc0930862a8d421a57a9580a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widget.self-fca20bcec06d192f97cffa6e734e24360e227237b8ae7d7e7e60754df7d5444f.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widgets/menu.self-0730fe713007bd93e6db569352a20ed92448299505ff6f525bc0dc6dd488254e.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widgets/autocomplete.self-6a89d7a43741ec810ef95de143a7c0297e2e4368ebecff64493ebb7a9ac3a524.js?body=1>; rel=preload; as=script; nopush,</assets/select2-full.self-d5e1e19d781019584e664acc85a49645cc5714ab34b0636238e360e74b09ec81.js?body=1>; rel=preload; as=script; nopush,</assets/underscore-min.self-4f5b2528815d8b1cd9b68b1a4bb1fe689696f8dcbc2c4a5104343b886ee68828.js?body=1>; rel=preload; as=script; nopush,</assets/jsuri.self-32d1bf44ffa16da5b2ea10c661f790bf0944362395283a91baf62d43407f10ba.js?body=1>; rel=preload; as=script; nopush,</assets/spree.self-6bcfe44ae87739660ed040daa0edf76a30404c94b29ce19da816cbb15a50c870.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/spree-select2.self-71ff1b520edab940a88f7d1bfc46193b517c516e745863a43844b61c27ddbaa3.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/address_states.self-1d16490b37ad081d3a12dbbb3b86c10734273a4eb5ed569c3d5e6504d549a652.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/adjustments.self-c908b5be29df51a21d592a683626d8877aef561d062f8f6ab9578621ac5d7deb.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/admin.self-693600ce98a000655eeba77d2b60313ce2497f0b8efcd018ab17169a0577177f.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/calculator.self-b6658418540994261dca22cddbd69b75720d21d406a0a01bd485e1deb91d5906.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/checkouts/edit.self-52292b6b968612a6c399895d4c76353955cc1e2246ffc525dec9bb7931094c2e.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/gateway.self-637b84d9fe372d124e7e5086c088e4216f3465f177de7d79c723537ba490dde4.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/general_settings.self-d398d44629f20bc846e2d990a7b76774f083c0d9c11c21d3f2c16aadaa82d9c5.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/handlebar_extensions.self-c4d09b514cd78338c8cb1e32dcd2d4ed550e7c82647a8168cf231d923d00b3f7.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/line_items.self-8836b4d1af2c3e80c54eec01235b1578cdfbf077fa83cb0029c34d4109db3ed6.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/line_items_on_order_edit.self-612f4e01e706d9cc78c5aba18c1879e1cc6474ac1456886a59581a0422e02bea.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend.self-a65ca83b0d8e01d1b447bc2c6a331a669955035caf477ef0c25a56f991037607.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/multi_currency.self-d593f22b8abe9c498a27c0c7af584e2d708caa5796e852a4caead43d24b8af1a.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/option_type_autocomplete.self-6eb73c910efaa30cd6eb1eb506bbbb9f520d83ffb0d05ed7e2a94bd72a7500b3.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/option_value_picker.self-89a602ce6e3b2cb522e60e23e74b717930984cd211326f020efcb6fdcc40467f.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/orders/edit.self-30a5ed55545ef85699e078047614cb5ac4e4836bd24a7b07e6fddc259d93ece7.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/payments/edit.self-28e427e9a999ca397a7909c7538e7a40326ea979b64e7d6dc135d7563887a861.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/payments/new.self-b7b11729b886e03baab8d39b5a50dcd106fc6b563e650858762e126aae1253cc.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/product_picker.self-b9fe5fbbcc8e45e59bc191138ae99ef390fff56ec43cdfc16a3666c3b69eee3e.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/progress.self-ac1f801ec8447c66ec90c134267f3ae1f385edea4ce6ea1a16730c1629d91fcb.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/promotions.self-0381ec5a07dfcbc0128dc5706fc85a489bd71f498fdd8cc6ac6c4f8cf0ec3380.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/returns/expedited_exchanges_warning.self-952b22e687c03159997ea167562bb020f5c4e719ee307076a058a8b04e4881ab.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/returns/return_item_selection.self-280d02ebcfcb36771057278be47409a3aea0c885b82e90953ea0e26130e1a2fb.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/shipments.self-87f7797a5a8e86fecd5babf793034f2ac06186fc72d11053d898db37c13bb4f2.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/states.self-8875c98288f6687438feafbc36a8c41cb2c7d1562793032af550e4b3770d2cfd.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/stock_location.self-06fe4828a51a6236734afe0ed8e59a73d1314388e320d3a2b0483d276127a623.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/stock_management.self-f618833252f6e4ddbde90b93e491966e0eeee716f9602194fdec9c198d0b3ac4.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/stock_movement.self-113482929f2af10470cd882117be1498cbaab01d5220fe00b0ccfcc76f794d6b.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/stock_transfer.self-80301755b46e190eb3c20d7eb1301d068754a31440758296460e686cf895c821.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/taxon_autocomplete.self-3cd661c38339f4f82ba7644191a86df8e12989c06e46eb500c624e0b893988f8.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/taxon_permalink_preview.self-0409f167f3f779dcbcc9cdf695af2b61fe8293be4a366eaf4d44e902c34084a3.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/taxon_tree_menu.self-f8bd9e5f9777b25df831dc70fefac7146065de5aaf93e247ab1d13604c70310c.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/taxonomy.self-e2228720cfb76ac48f6026741336bb8ef45ef773feebbd9565f843fbe3840641.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/taxons.self-47c55d2e011d1e43d2306fe79eb2a4f4dd3b4ba4f8f5b84be9104a094696429f.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/users/edit.self-61d2062e3c7af57c958e69af39428da1ec168d1c95381a4f34937894c2d101cc.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/user_picker.self-db0d6da7e108f81487af251ce1a80e7a711cc116f2670e785b6b10a56d9d4243.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/variant_autocomplete.self-301b39b21fd9fd157dd887b3652cd6cf6bf277a64b003e0ff47a96e1f010389e.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/variant_management.self-83ba286b3e5c05f9964732a000c55943327ed1dc7888974740f6ae05829566fa.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/zone.self-52966ad40be27143d046936c2da8e9b688eb539d47baf7ee17864db179df6414.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/all.self-ac4347b135ab8935f2dd20089f2acc8bec1d6b2ad528a80fcb03cd445dbd4d27.js?body=1>; rel=preload; as=script; nopush,</assets/select2_locale_en.self-9fe9edd5fbbdf7151ed20459f39a1c3d9cdce1916c0d04737620f998439e784f.js?body=1>; rel=preload; as=script; nopush,</assets/flatpickr/l10n/default.self-b39e1a541baf193385a84738d77c5a54c7dd5c3117fbcc26f3550f6203a295b7.js?body=1>; rel=preload; as=script; nopush
Content-Type: text/html; charset=utf-8
ETag: W/"a3b88ca70f8ab4b247de5554fb498e8e"
Cache-Control: max-age=0, private, must-revalidate
Set-Cookie: _store_session=0%2BIVGpmBrXrpvnyAk%2FqtG73t2M1TBFW3ZU1fwnsjbLujGgjFyKbWkv3KXsvaw1y23DOQ4mIlz8kapr58%2F8%2FqrxGdWtPtsFrHi6DugfIMvlnh7OGo2aO57bLOGn%2FSNF5lFxvYWc9NSqb0EGwaTBozlkj9OxV1tmYNvjH95kBR2U3tcHutdcB9r%2FRORZhquLFKuQeC%2B9WDwwmzRVGNfJ%2BR18gjl0tGQ%2BrnGsVTEiUtRZ6J%2Bk57TuJNocY%2BtbDpnbrBrMXjtM5Eq9kKYMTO4NR3YRHdJLkyfc1b02WeTKVAQeqk0DxpFxq2Tq9ksMyxAipKWgelE%2BbfrOVk3w5Eqze7pS%2FlLrRBDPGBrSsuCOkUZ6trnkuDG0kftQzcGgJP158Q0J9RU5zudjY0kxqJapFyZ0SxWJ%2BXPxH6Cke4SAIgzDu%2BkqXZSxtLzr3kzleyvEUhUH6dtT1XtqBLilrH79AheIRAgXBblQyyFgOnaBw753hToZjCCMiuTB1BRaA%3D--RNKCVv76Uu%2Bq8DRC--fIsT9BMj2fnOAcHf9%2BNxSA%3D%3D; path=/; HttpOnly; SameSite=Lax
X-Request-Id: 60bd6bca-2fd2-431d-8d88-f2b7601cea34
X-Runtime: 0.326021
Transfer-Encoding: chunked
请注意 Content-Type
存在。
但是当我通过 Apache (http://localhost:8000/store/admin/orders/) 访问同一页面(或 /store/admin/ 下的任何其他页面)时,我得到的是:
HTTP/1.1 200 OK
Date: Thu, 25 Feb 2021 09:17:27 GMT
Server: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Link: </assets/jquery-ui/theme.self-706610e33a9ca23fe976ec6c425ca1ef84a7b054e058b3e552b026c31182f86d.css?body=1>; rel=preload; as=style; nopush,</assets/jquery-ui/autocomplete.self-f0b810a4a7bb8c90994675d7c5bfe636d615a5785cf81cae3340aa5e6adc55ca.css?body=1>; rel=preload; as=style; nopush,</assets/select2.self-20a5067d001f14dc1171e7088048f4cdbf504eab24351837fa7238667b52eb69.css?body=1>; rel=preload; as=style; nopush,</assets/animate.self-ccd089adb225743875de4990ac63f473911699215826b255476a0bb784fe9d9c.css?body=1>; rel=preload; as=style; nopush,</assets/flatpickr.self-135130d7b1cbb1e166f6d77e122c442329cb012401226a084c5212b5a62b61c7.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend/spree_admin.self-8cbb9e055b620fd84602a8114c7cac7f0456bc074f2a0ee383153d379e79c9b0.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend.self-4984d37b1be7d78543cf464fae996bcd8e0e8a72c929b2ded5fde626869184f7.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend/all.self-33fc4a513acb9a5f3fd4ba26b89c94184e5d028c4bd40eee6736d3ccfea5c140.css?body=1>; rel=preload; as=style; nopush,</assets/modernizr.self-e2a216f830f95df2a1a5ee07c11b930e8b8023503327c46509eab917124b956b.js?body=1>; rel=preload; as=script; nopush,</assets/purify.self-2c62ea8bace8181f9a3b47a3248869cee423fe7bea458400500f4440d61e9227.js?body=1>; rel=preload; as=script; nopush,</assets/sortable.self-c9fce5f0d6c69bde788b93cf4dbaa66f9c374567ec702b91ba9cce4215036231.js?body=1>; rel=preload; as=script; nopush,</assets/flatpickr.self-ff20c31266dbe4dafc71b4ad82970c00ed83137a79c201fcb1743fa21d96a1a4.js?body=1>; rel=preload; as=script; nopush,</assets/jquery3.self-2a83d06853bd343c7bfc2e5d4539814cfa934676e2948ed348311435eca862f5.js?body=1>; rel=preload; as=script; nopush,</assets/popper.self-55bd1408b0e4ff3edf21524b78fbe2266615c8015ce0e5f0828089b1de27d63c.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/util.self-0f5e3d6a124973f023aa2dd48e39d4dae20bef128eb66edd89cad98921d5b731.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/dropdown.self-388352e554187a9ed5e38014a35052e89a39a52fcc3a38f8b273a126985d107c.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/tab.self-2bc5ce357bf6f839ac0eaebc053ee14ff7fab962a72e6e626816d2d0d9cf4ea1.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/collapse.self-819a76b712a356583f2daf0a7a43d03e870b6e12fbb0cd213504ed0a29afce57.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/modal.self-78fca8dd620c5c40de1ff1577a9671f2aa64fec856e5500a3e3988db33f2c079.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/alert.self-7910197be375fc8369715847d5176b16053a5676992d82669332fa58c7adecdb.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/button.self-4902e68356649c387d8225a760822984725a7277b1910d988a3b16e9b90286ff.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/scrollspy.self-a22b4a59e90f230257720ad55234915bfc9ce23fb39c4663505565f3851d782e.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/toast.self-cdff30d8b7acb329687f0ab252895951e15288e879d2bc7c67da241712fd4b2f.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/tooltip.self-e27ff78a3b7483ee1e081d878fde16c8ae3f2048904bf829f1f8500c3532b42a.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/carousel.self-aea44cc40d4583fb16021b37cd491d0fd75ec158082386427186a6a10b9ae762.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/popover.self-632bb01a3518dbf001a12224ea49425964dd4faa2f9cd9f50b5c65e910836d80.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap-sprockets.self-fbfa5ad7d9aa0afe439ec4ff3883acc4cb92b62cb67c40d674320c9aa1d4642d.js?body=1>; rel=preload; as=script; nopush,</assets/handlebars.self-b2608718817462056ff3eaeb15624e6538f38e38d14c0cc307fb837f506c6c7c.js?body=1>; rel=preload; as=script; nopush,</assets/cleave.self-4bfd99b74c3b284fcfb77c7af7ff322d027caf55899c0dfc47f84437cb052b61.js?body=1>; rel=preload; as=script; nopush,</assets/js.cookie.self-7c886e54899b328d9497acda8316f6bf1a1a612a83a0e14cb4d0f9aaa5004c44.js?body=1>; rel=preload; as=script; nopush,</assets/jquery.jstree/jquery.jstree.self-a709466be3723778dda397286f84ef8e16169b798037462b658b43c95bffb595.js?body=1>; rel=preload; as=script; nopush,</assets/jquery_ujs.self-784a997f6726036b1993eb2217c9cb558e1cbb801c6da88105588c56f13b466a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/version.self-c8e3d1203da26ea7efdf83c1eabb3f0ba55cb68e463f5ccf0d77bd15ce6a8e61.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/keycode.self-ad63cd20acf49dd333bbbc537454d7d475bd610eb5b88de0dca009f0c3d314b1.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/position.self-1b49c8c521e67a4a88bfdad6b4d944d33686d25009a0e40a1e170acdd7b6962a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/safe-active-element.self-a1f1a1a7dae3269ce03f6fffb2dcc9b4a7490f5d546c65d54417bec3be24b668.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/unique-id.self-66e85ac85cd0b6b8b1bb89369fc65f608f716869dc0930862a8d421a57a9580a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widget.self-fca20bcec06d192f97cffa6e734e24360e227237b8ae7d7e7e60754df7d5444f.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widgets/menu.self-0730fe713007bd93e6db569352a20ed92448299505ff6f525bc0dc6dd488254e.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widgets/autocomplete.self-6a89d7a43741ec810ef95de143a7c0297e2e4368ebecff64493ebb7a9ac3a524.js?body=1>; rel=preload; as=script; nopush,</assets/select2-full.self-d5e1e19d781019584e664acc85a49645cc5714ab34b0636238e360e74b09ec81.js?body=1>; rel=preload; as=script; nopush,</assets/underscore-min.self-4f5b2528815d8b1cd9b68b1a4bb1fe689696f8dcbc2c4a5104343b886ee68828.js?body=1>; rel=preload; as=script; nopush,</assets/jsuri.self-32d1bf44ffa16da5b2ea10c661f790bf0944362395283a91baf62d43407f10ba.js?body=1>; rel=preload; as=script; nopush,</assets/spree.self-6bcfe44ae87739660ed040daa0edf76a30404c94b29ce19da816cbb15a50c870.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/spree-select2.self-71ff1b520edab940a88f7d1bfc46193b517c516e745863a43844b61c27ddbaa3.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/address_states.self-1d16490b37ad081d3a12dbbb3b86c10734273a4eb5ed569c3d5e6504d549a652.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/adjustments.self-c908b5be29df51a21d592a683626d8877aef561d062f8f6ab9578621ac5d7deb.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/admin.self-693600ce98a000655eeba77d2b60313ce2497f0b8efcd018ab17169a0577177f.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/calculator.self-b6658418540994261dca22cddbd69b75720d21d406a0a01bd485e1deb91d5906.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/checkouts/edit.self-52292b6b968612a6c399895d4c76353955cc1e2246ffc525dec9bb7931094c2e.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/gateway.self-637b84d9fe372d124e7e5086c088e4216f3465f177de7d79c723537ba490dde4.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/general_settings.self-d398d44629f20bc846e2d990a7b76774f083c0d9c11c21d3f2c16aadaa82d9c5.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/handlebar_extensions.self-c4d09b514cd78338c8cb1e32dcd2d4ed550e7c82647a8168cf231d923d00b3f7.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/line_items.self-8836b4d1af2c3e80c54eec01235b1578cdfbf077fa83cb0029c34d4109db3ed6.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/line_items_on_order_edit.self-612f4e01e706d9cc78c5aba18c1879e1cc6474ac1456886a59581a0422e02bea.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend.self-a65ca83b0d8e01d1b447bc2c6a331a66
ETag: W/"f9eccac0ce588fe0c01e2fd739bc8d7b"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: b568eaf5-bd34-47ca-a235-690770c59a68
X-Runtime: 0.336446
Set-Cookie: _store_session=warAcwShWYD01kmquBk8P7V0YvKtBBhZdyNjnpyV%2B%2FVopHvQQ6Kyu1f795HjNCqXm8n6Es%2BqJU1DPwxmt6SQGPn8Yy7k11z92WtANujagcqAS9FamUnkp%2FLdXsGFnidjuCMbLx%2Bk0l6RRkMoo6Qx6%2BKJRGUCt0cROFQrx1P3D7fV9Y1uWRiif4E5yuHTU1tdAAFc%2FYqOM5yhR7ibiRmNB7IcjifPimleVp%2F24b2UsgusMlcC52QzkPcdK%2BUw8tGvjC%2FAq7BGunXfdFhrICjPd8oIoHMdOmki3MmQDTu0KfA8KB%2B5L3K6AJ0kgBOnazXStqAaru%2F0dQpFLqPIzeuUjArnQmxksBCggTZ5sRxdrCZAnC3Wjg3Hfx0Mbw49FY9mlDZKWUaj1YxUeVlA3wpJ9wTwAnYI%2BJyNVRkUgASuOEDkGYDhE0Z9J9yjolQecRB1dVZsnqzv4Dsza1fUWuQENrNlkmCmV5yJIMb2a7zR997IdPo%2Fsyugj6yeAn0%3D--yjVFUWTB0JfpISA9--07cks1cvGN%2FUIJlFhyOYNQ%3D%3D; path=/; HttpOnly; SameSite=Lax
Keep-Alive: timeout=300, max=200
Connection: Keep-Alive
Transfer-Encoding: chunked
没有Content-Type
,所以浏览器尝试下载它。
知道这可能是什么原因吗?
编辑:我注意到 Link
header 很大并且被 Apache 截断了,所以我将 Header unset Link
添加到我的虚拟主机配置中。没有发送了,问题依旧
找到问题了。
Rails 最近开始发送包含所有资源的 Link
header,以便浏览器可以预加载它们。 See this PR.
问题是在开发过程中 header 会变得相当大(就像我的管理页面一样)。 Puma 与巨人 header 配合得很好,但 Apache 将 header 截断为 8 KiB(其中 7.58 是截断的 Link
header)并且不发送一个完整的响应,因此缺少 Content-Type
.
我只是通过将此添加到 config/environments/development.rb
来禁用 Rails (see this PR) 中的功能:
config.action_view.preload_links_header = false
并重新启动服务器。
这在生产中不太可能成为问题,因为资产通常会进行预编译和连接。
我有这个简单的 Apache 虚拟主机,它是唯一启用的:
<VirtualHost *:8000>
ServerName store.com
ServerAdmin admin@store.com
DocumentRoot /var/www/store/public
ErrorLog ${APACHE_LOG_DIR}/store-error.log
CustomLog ${APACHE_LOG_DIR}/store-access.log combined
ProxyPreserveHost On
ProxyRequests Off
<Proxy *>
Order Allow,Deny
Allow from all
</Proxy>
# Pass requests to puma
ProxyPass / http://127.0.0.1:8090/
ProxyPassReverse / http://127.0.0.1:8090/
</VirtualHost>
上游是 Puma 服务 运行 Ruby Rails/Spree。
当我通过 Apache (http://store.com:8000/store/) or directly through Puma (http://store.com:8090/store/) 访问商店根路径时,它对两者都非常有效。响应的Content-Type
header设置为text/html; charset=utf-8
.
当我在端口 8090 (http://store.com:8090/store/admin/orders/) 上直接通过 Puma 访问管理页面时,它也能正常工作,并向我发送这些 headers:
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Link: </assets/jquery-ui/theme.self-706610e33a9ca23fe976ec6c425ca1ef84a7b054e058b3e552b026c31182f86d.css?body=1>; rel=preload; as=style; nopush,</assets/jquery-ui/autocomplete.self-f0b810a4a7bb8c90994675d7c5bfe636d615a5785cf81cae3340aa5e6adc55ca.css?body=1>; rel=preload; as=style; nopush,</assets/select2.self-20a5067d001f14dc1171e7088048f4cdbf504eab24351837fa7238667b52eb69.css?body=1>; rel=preload; as=style; nopush,</assets/animate.self-ccd089adb225743875de4990ac63f473911699215826b255476a0bb784fe9d9c.css?body=1>; rel=preload; as=style; nopush,</assets/flatpickr.self-135130d7b1cbb1e166f6d77e122c442329cb012401226a084c5212b5a62b61c7.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend/spree_admin.self-8cbb9e055b620fd84602a8114c7cac7f0456bc074f2a0ee383153d379e79c9b0.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend.self-4984d37b1be7d78543cf464fae996bcd8e0e8a72c929b2ded5fde626869184f7.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend/all.self-33fc4a513acb9a5f3fd4ba26b89c94184e5d028c4bd40eee6736d3ccfea5c140.css?body=1>; rel=preload; as=style; nopush,</assets/modernizr.self-e2a216f830f95df2a1a5ee07c11b930e8b8023503327c46509eab917124b956b.js?body=1>; rel=preload; as=script; nopush,</assets/purify.self-2c62ea8bace8181f9a3b47a3248869cee423fe7bea458400500f4440d61e9227.js?body=1>; rel=preload; as=script; nopush,</assets/sortable.self-c9fce5f0d6c69bde788b93cf4dbaa66f9c374567ec702b91ba9cce4215036231.js?body=1>; rel=preload; as=script; nopush,</assets/flatpickr.self-ff20c31266dbe4dafc71b4ad82970c00ed83137a79c201fcb1743fa21d96a1a4.js?body=1>; rel=preload; as=script; nopush,</assets/jquery3.self-2a83d06853bd343c7bfc2e5d4539814cfa934676e2948ed348311435eca862f5.js?body=1>; rel=preload; as=script; nopush,</assets/popper.self-55bd1408b0e4ff3edf21524b78fbe2266615c8015ce0e5f0828089b1de27d63c.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/util.self-0f5e3d6a124973f023aa2dd48e39d4dae20bef128eb66edd89cad98921d5b731.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/dropdown.self-388352e554187a9ed5e38014a35052e89a39a52fcc3a38f8b273a126985d107c.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/tab.self-2bc5ce357bf6f839ac0eaebc053ee14ff7fab962a72e6e626816d2d0d9cf4ea1.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/collapse.self-819a76b712a356583f2daf0a7a43d03e870b6e12fbb0cd213504ed0a29afce57.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/modal.self-78fca8dd620c5c40de1ff1577a9671f2aa64fec856e5500a3e3988db33f2c079.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/alert.self-7910197be375fc8369715847d5176b16053a5676992d82669332fa58c7adecdb.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/button.self-4902e68356649c387d8225a760822984725a7277b1910d988a3b16e9b90286ff.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/scrollspy.self-a22b4a59e90f230257720ad55234915bfc9ce23fb39c4663505565f3851d782e.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/toast.self-cdff30d8b7acb329687f0ab252895951e15288e879d2bc7c67da241712fd4b2f.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/tooltip.self-e27ff78a3b7483ee1e081d878fde16c8ae3f2048904bf829f1f8500c3532b42a.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/carousel.self-aea44cc40d4583fb16021b37cd491d0fd75ec158082386427186a6a10b9ae762.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/popover.self-632bb01a3518dbf001a12224ea49425964dd4faa2f9cd9f50b5c65e910836d80.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap-sprockets.self-fbfa5ad7d9aa0afe439ec4ff3883acc4cb92b62cb67c40d674320c9aa1d4642d.js?body=1>; rel=preload; as=script; nopush,</assets/handlebars.self-b2608718817462056ff3eaeb15624e6538f38e38d14c0cc307fb837f506c6c7c.js?body=1>; rel=preload; as=script; nopush,</assets/cleave.self-4bfd99b74c3b284fcfb77c7af7ff322d027caf55899c0dfc47f84437cb052b61.js?body=1>; rel=preload; as=script; nopush,</assets/js.cookie.self-7c886e54899b328d9497acda8316f6bf1a1a612a83a0e14cb4d0f9aaa5004c44.js?body=1>; rel=preload; as=script; nopush,</assets/jquery.jstree/jquery.jstree.self-a709466be3723778dda397286f84ef8e16169b798037462b658b43c95bffb595.js?body=1>; rel=preload; as=script; nopush,</assets/jquery_ujs.self-784a997f6726036b1993eb2217c9cb558e1cbb801c6da88105588c56f13b466a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/version.self-c8e3d1203da26ea7efdf83c1eabb3f0ba55cb68e463f5ccf0d77bd15ce6a8e61.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/keycode.self-ad63cd20acf49dd333bbbc537454d7d475bd610eb5b88de0dca009f0c3d314b1.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/position.self-1b49c8c521e67a4a88bfdad6b4d944d33686d25009a0e40a1e170acdd7b6962a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/safe-active-element.self-a1f1a1a7dae3269ce03f6fffb2dcc9b4a7490f5d546c65d54417bec3be24b668.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/unique-id.self-66e85ac85cd0b6b8b1bb89369fc65f608f716869dc0930862a8d421a57a9580a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widget.self-fca20bcec06d192f97cffa6e734e24360e227237b8ae7d7e7e60754df7d5444f.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widgets/menu.self-0730fe713007bd93e6db569352a20ed92448299505ff6f525bc0dc6dd488254e.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widgets/autocomplete.self-6a89d7a43741ec810ef95de143a7c0297e2e4368ebecff64493ebb7a9ac3a524.js?body=1>; rel=preload; as=script; nopush,</assets/select2-full.self-d5e1e19d781019584e664acc85a49645cc5714ab34b0636238e360e74b09ec81.js?body=1>; rel=preload; as=script; nopush,</assets/underscore-min.self-4f5b2528815d8b1cd9b68b1a4bb1fe689696f8dcbc2c4a5104343b886ee68828.js?body=1>; rel=preload; as=script; nopush,</assets/jsuri.self-32d1bf44ffa16da5b2ea10c661f790bf0944362395283a91baf62d43407f10ba.js?body=1>; rel=preload; as=script; nopush,</assets/spree.self-6bcfe44ae87739660ed040daa0edf76a30404c94b29ce19da816cbb15a50c870.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/spree-select2.self-71ff1b520edab940a88f7d1bfc46193b517c516e745863a43844b61c27ddbaa3.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/address_states.self-1d16490b37ad081d3a12dbbb3b86c10734273a4eb5ed569c3d5e6504d549a652.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/adjustments.self-c908b5be29df51a21d592a683626d8877aef561d062f8f6ab9578621ac5d7deb.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/admin.self-693600ce98a000655eeba77d2b60313ce2497f0b8efcd018ab17169a0577177f.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/calculator.self-b6658418540994261dca22cddbd69b75720d21d406a0a01bd485e1deb91d5906.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/checkouts/edit.self-52292b6b968612a6c399895d4c76353955cc1e2246ffc525dec9bb7931094c2e.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/gateway.self-637b84d9fe372d124e7e5086c088e4216f3465f177de7d79c723537ba490dde4.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/general_settings.self-d398d44629f20bc846e2d990a7b76774f083c0d9c11c21d3f2c16aadaa82d9c5.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/handlebar_extensions.self-c4d09b514cd78338c8cb1e32dcd2d4ed550e7c82647a8168cf231d923d00b3f7.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/line_items.self-8836b4d1af2c3e80c54eec01235b1578cdfbf077fa83cb0029c34d4109db3ed6.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/line_items_on_order_edit.self-612f4e01e706d9cc78c5aba18c1879e1cc6474ac1456886a59581a0422e02bea.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend.self-a65ca83b0d8e01d1b447bc2c6a331a669955035caf477ef0c25a56f991037607.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/multi_currency.self-d593f22b8abe9c498a27c0c7af584e2d708caa5796e852a4caead43d24b8af1a.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/option_type_autocomplete.self-6eb73c910efaa30cd6eb1eb506bbbb9f520d83ffb0d05ed7e2a94bd72a7500b3.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/option_value_picker.self-89a602ce6e3b2cb522e60e23e74b717930984cd211326f020efcb6fdcc40467f.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/orders/edit.self-30a5ed55545ef85699e078047614cb5ac4e4836bd24a7b07e6fddc259d93ece7.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/payments/edit.self-28e427e9a999ca397a7909c7538e7a40326ea979b64e7d6dc135d7563887a861.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/payments/new.self-b7b11729b886e03baab8d39b5a50dcd106fc6b563e650858762e126aae1253cc.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/product_picker.self-b9fe5fbbcc8e45e59bc191138ae99ef390fff56ec43cdfc16a3666c3b69eee3e.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/progress.self-ac1f801ec8447c66ec90c134267f3ae1f385edea4ce6ea1a16730c1629d91fcb.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/promotions.self-0381ec5a07dfcbc0128dc5706fc85a489bd71f498fdd8cc6ac6c4f8cf0ec3380.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/returns/expedited_exchanges_warning.self-952b22e687c03159997ea167562bb020f5c4e719ee307076a058a8b04e4881ab.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/returns/return_item_selection.self-280d02ebcfcb36771057278be47409a3aea0c885b82e90953ea0e26130e1a2fb.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/shipments.self-87f7797a5a8e86fecd5babf793034f2ac06186fc72d11053d898db37c13bb4f2.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/states.self-8875c98288f6687438feafbc36a8c41cb2c7d1562793032af550e4b3770d2cfd.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/stock_location.self-06fe4828a51a6236734afe0ed8e59a73d1314388e320d3a2b0483d276127a623.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/stock_management.self-f618833252f6e4ddbde90b93e491966e0eeee716f9602194fdec9c198d0b3ac4.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/stock_movement.self-113482929f2af10470cd882117be1498cbaab01d5220fe00b0ccfcc76f794d6b.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/stock_transfer.self-80301755b46e190eb3c20d7eb1301d068754a31440758296460e686cf895c821.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/taxon_autocomplete.self-3cd661c38339f4f82ba7644191a86df8e12989c06e46eb500c624e0b893988f8.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/taxon_permalink_preview.self-0409f167f3f779dcbcc9cdf695af2b61fe8293be4a366eaf4d44e902c34084a3.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/taxon_tree_menu.self-f8bd9e5f9777b25df831dc70fefac7146065de5aaf93e247ab1d13604c70310c.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/taxonomy.self-e2228720cfb76ac48f6026741336bb8ef45ef773feebbd9565f843fbe3840641.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/taxons.self-47c55d2e011d1e43d2306fe79eb2a4f4dd3b4ba4f8f5b84be9104a094696429f.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/users/edit.self-61d2062e3c7af57c958e69af39428da1ec168d1c95381a4f34937894c2d101cc.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/user_picker.self-db0d6da7e108f81487af251ce1a80e7a711cc116f2670e785b6b10a56d9d4243.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/variant_autocomplete.self-301b39b21fd9fd157dd887b3652cd6cf6bf277a64b003e0ff47a96e1f010389e.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/variant_management.self-83ba286b3e5c05f9964732a000c55943327ed1dc7888974740f6ae05829566fa.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/zone.self-52966ad40be27143d046936c2da8e9b688eb539d47baf7ee17864db179df6414.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/all.self-ac4347b135ab8935f2dd20089f2acc8bec1d6b2ad528a80fcb03cd445dbd4d27.js?body=1>; rel=preload; as=script; nopush,</assets/select2_locale_en.self-9fe9edd5fbbdf7151ed20459f39a1c3d9cdce1916c0d04737620f998439e784f.js?body=1>; rel=preload; as=script; nopush,</assets/flatpickr/l10n/default.self-b39e1a541baf193385a84738d77c5a54c7dd5c3117fbcc26f3550f6203a295b7.js?body=1>; rel=preload; as=script; nopush
Content-Type: text/html; charset=utf-8
ETag: W/"a3b88ca70f8ab4b247de5554fb498e8e"
Cache-Control: max-age=0, private, must-revalidate
Set-Cookie: _store_session=0%2BIVGpmBrXrpvnyAk%2FqtG73t2M1TBFW3ZU1fwnsjbLujGgjFyKbWkv3KXsvaw1y23DOQ4mIlz8kapr58%2F8%2FqrxGdWtPtsFrHi6DugfIMvlnh7OGo2aO57bLOGn%2FSNF5lFxvYWc9NSqb0EGwaTBozlkj9OxV1tmYNvjH95kBR2U3tcHutdcB9r%2FRORZhquLFKuQeC%2B9WDwwmzRVGNfJ%2BR18gjl0tGQ%2BrnGsVTEiUtRZ6J%2Bk57TuJNocY%2BtbDpnbrBrMXjtM5Eq9kKYMTO4NR3YRHdJLkyfc1b02WeTKVAQeqk0DxpFxq2Tq9ksMyxAipKWgelE%2BbfrOVk3w5Eqze7pS%2FlLrRBDPGBrSsuCOkUZ6trnkuDG0kftQzcGgJP158Q0J9RU5zudjY0kxqJapFyZ0SxWJ%2BXPxH6Cke4SAIgzDu%2BkqXZSxtLzr3kzleyvEUhUH6dtT1XtqBLilrH79AheIRAgXBblQyyFgOnaBw753hToZjCCMiuTB1BRaA%3D--RNKCVv76Uu%2Bq8DRC--fIsT9BMj2fnOAcHf9%2BNxSA%3D%3D; path=/; HttpOnly; SameSite=Lax
X-Request-Id: 60bd6bca-2fd2-431d-8d88-f2b7601cea34
X-Runtime: 0.326021
Transfer-Encoding: chunked
请注意 Content-Type
存在。
但是当我通过 Apache (http://localhost:8000/store/admin/orders/) 访问同一页面(或 /store/admin/ 下的任何其他页面)时,我得到的是:
HTTP/1.1 200 OK
Date: Thu, 25 Feb 2021 09:17:27 GMT
Server: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Link: </assets/jquery-ui/theme.self-706610e33a9ca23fe976ec6c425ca1ef84a7b054e058b3e552b026c31182f86d.css?body=1>; rel=preload; as=style; nopush,</assets/jquery-ui/autocomplete.self-f0b810a4a7bb8c90994675d7c5bfe636d615a5785cf81cae3340aa5e6adc55ca.css?body=1>; rel=preload; as=style; nopush,</assets/select2.self-20a5067d001f14dc1171e7088048f4cdbf504eab24351837fa7238667b52eb69.css?body=1>; rel=preload; as=style; nopush,</assets/animate.self-ccd089adb225743875de4990ac63f473911699215826b255476a0bb784fe9d9c.css?body=1>; rel=preload; as=style; nopush,</assets/flatpickr.self-135130d7b1cbb1e166f6d77e122c442329cb012401226a084c5212b5a62b61c7.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend/spree_admin.self-8cbb9e055b620fd84602a8114c7cac7f0456bc074f2a0ee383153d379e79c9b0.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend.self-4984d37b1be7d78543cf464fae996bcd8e0e8a72c929b2ded5fde626869184f7.css?body=1>; rel=preload; as=style; nopush,</assets/spree/backend/all.self-33fc4a513acb9a5f3fd4ba26b89c94184e5d028c4bd40eee6736d3ccfea5c140.css?body=1>; rel=preload; as=style; nopush,</assets/modernizr.self-e2a216f830f95df2a1a5ee07c11b930e8b8023503327c46509eab917124b956b.js?body=1>; rel=preload; as=script; nopush,</assets/purify.self-2c62ea8bace8181f9a3b47a3248869cee423fe7bea458400500f4440d61e9227.js?body=1>; rel=preload; as=script; nopush,</assets/sortable.self-c9fce5f0d6c69bde788b93cf4dbaa66f9c374567ec702b91ba9cce4215036231.js?body=1>; rel=preload; as=script; nopush,</assets/flatpickr.self-ff20c31266dbe4dafc71b4ad82970c00ed83137a79c201fcb1743fa21d96a1a4.js?body=1>; rel=preload; as=script; nopush,</assets/jquery3.self-2a83d06853bd343c7bfc2e5d4539814cfa934676e2948ed348311435eca862f5.js?body=1>; rel=preload; as=script; nopush,</assets/popper.self-55bd1408b0e4ff3edf21524b78fbe2266615c8015ce0e5f0828089b1de27d63c.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/util.self-0f5e3d6a124973f023aa2dd48e39d4dae20bef128eb66edd89cad98921d5b731.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/dropdown.self-388352e554187a9ed5e38014a35052e89a39a52fcc3a38f8b273a126985d107c.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/tab.self-2bc5ce357bf6f839ac0eaebc053ee14ff7fab962a72e6e626816d2d0d9cf4ea1.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/collapse.self-819a76b712a356583f2daf0a7a43d03e870b6e12fbb0cd213504ed0a29afce57.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/modal.self-78fca8dd620c5c40de1ff1577a9671f2aa64fec856e5500a3e3988db33f2c079.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/alert.self-7910197be375fc8369715847d5176b16053a5676992d82669332fa58c7adecdb.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/button.self-4902e68356649c387d8225a760822984725a7277b1910d988a3b16e9b90286ff.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/scrollspy.self-a22b4a59e90f230257720ad55234915bfc9ce23fb39c4663505565f3851d782e.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/toast.self-cdff30d8b7acb329687f0ab252895951e15288e879d2bc7c67da241712fd4b2f.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/tooltip.self-e27ff78a3b7483ee1e081d878fde16c8ae3f2048904bf829f1f8500c3532b42a.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/carousel.self-aea44cc40d4583fb16021b37cd491d0fd75ec158082386427186a6a10b9ae762.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap/popover.self-632bb01a3518dbf001a12224ea49425964dd4faa2f9cd9f50b5c65e910836d80.js?body=1>; rel=preload; as=script; nopush,</assets/bootstrap-sprockets.self-fbfa5ad7d9aa0afe439ec4ff3883acc4cb92b62cb67c40d674320c9aa1d4642d.js?body=1>; rel=preload; as=script; nopush,</assets/handlebars.self-b2608718817462056ff3eaeb15624e6538f38e38d14c0cc307fb837f506c6c7c.js?body=1>; rel=preload; as=script; nopush,</assets/cleave.self-4bfd99b74c3b284fcfb77c7af7ff322d027caf55899c0dfc47f84437cb052b61.js?body=1>; rel=preload; as=script; nopush,</assets/js.cookie.self-7c886e54899b328d9497acda8316f6bf1a1a612a83a0e14cb4d0f9aaa5004c44.js?body=1>; rel=preload; as=script; nopush,</assets/jquery.jstree/jquery.jstree.self-a709466be3723778dda397286f84ef8e16169b798037462b658b43c95bffb595.js?body=1>; rel=preload; as=script; nopush,</assets/jquery_ujs.self-784a997f6726036b1993eb2217c9cb558e1cbb801c6da88105588c56f13b466a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/version.self-c8e3d1203da26ea7efdf83c1eabb3f0ba55cb68e463f5ccf0d77bd15ce6a8e61.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/keycode.self-ad63cd20acf49dd333bbbc537454d7d475bd610eb5b88de0dca009f0c3d314b1.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/position.self-1b49c8c521e67a4a88bfdad6b4d944d33686d25009a0e40a1e170acdd7b6962a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/safe-active-element.self-a1f1a1a7dae3269ce03f6fffb2dcc9b4a7490f5d546c65d54417bec3be24b668.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/unique-id.self-66e85ac85cd0b6b8b1bb89369fc65f608f716869dc0930862a8d421a57a9580a.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widget.self-fca20bcec06d192f97cffa6e734e24360e227237b8ae7d7e7e60754df7d5444f.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widgets/menu.self-0730fe713007bd93e6db569352a20ed92448299505ff6f525bc0dc6dd488254e.js?body=1>; rel=preload; as=script; nopush,</assets/jquery-ui/widgets/autocomplete.self-6a89d7a43741ec810ef95de143a7c0297e2e4368ebecff64493ebb7a9ac3a524.js?body=1>; rel=preload; as=script; nopush,</assets/select2-full.self-d5e1e19d781019584e664acc85a49645cc5714ab34b0636238e360e74b09ec81.js?body=1>; rel=preload; as=script; nopush,</assets/underscore-min.self-4f5b2528815d8b1cd9b68b1a4bb1fe689696f8dcbc2c4a5104343b886ee68828.js?body=1>; rel=preload; as=script; nopush,</assets/jsuri.self-32d1bf44ffa16da5b2ea10c661f790bf0944362395283a91baf62d43407f10ba.js?body=1>; rel=preload; as=script; nopush,</assets/spree.self-6bcfe44ae87739660ed040daa0edf76a30404c94b29ce19da816cbb15a50c870.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/spree-select2.self-71ff1b520edab940a88f7d1bfc46193b517c516e745863a43844b61c27ddbaa3.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/address_states.self-1d16490b37ad081d3a12dbbb3b86c10734273a4eb5ed569c3d5e6504d549a652.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/adjustments.self-c908b5be29df51a21d592a683626d8877aef561d062f8f6ab9578621ac5d7deb.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/admin.self-693600ce98a000655eeba77d2b60313ce2497f0b8efcd018ab17169a0577177f.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/calculator.self-b6658418540994261dca22cddbd69b75720d21d406a0a01bd485e1deb91d5906.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/checkouts/edit.self-52292b6b968612a6c399895d4c76353955cc1e2246ffc525dec9bb7931094c2e.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/gateway.self-637b84d9fe372d124e7e5086c088e4216f3465f177de7d79c723537ba490dde4.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/general_settings.self-d398d44629f20bc846e2d990a7b76774f083c0d9c11c21d3f2c16aadaa82d9c5.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/handlebar_extensions.self-c4d09b514cd78338c8cb1e32dcd2d4ed550e7c82647a8168cf231d923d00b3f7.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/line_items.self-8836b4d1af2c3e80c54eec01235b1578cdfbf077fa83cb0029c34d4109db3ed6.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend/line_items_on_order_edit.self-612f4e01e706d9cc78c5aba18c1879e1cc6474ac1456886a59581a0422e02bea.js?body=1>; rel=preload; as=script; nopush,</assets/spree/backend.self-a65ca83b0d8e01d1b447bc2c6a331a66
ETag: W/"f9eccac0ce588fe0c01e2fd739bc8d7b"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: b568eaf5-bd34-47ca-a235-690770c59a68
X-Runtime: 0.336446
Set-Cookie: _store_session=warAcwShWYD01kmquBk8P7V0YvKtBBhZdyNjnpyV%2B%2FVopHvQQ6Kyu1f795HjNCqXm8n6Es%2BqJU1DPwxmt6SQGPn8Yy7k11z92WtANujagcqAS9FamUnkp%2FLdXsGFnidjuCMbLx%2Bk0l6RRkMoo6Qx6%2BKJRGUCt0cROFQrx1P3D7fV9Y1uWRiif4E5yuHTU1tdAAFc%2FYqOM5yhR7ibiRmNB7IcjifPimleVp%2F24b2UsgusMlcC52QzkPcdK%2BUw8tGvjC%2FAq7BGunXfdFhrICjPd8oIoHMdOmki3MmQDTu0KfA8KB%2B5L3K6AJ0kgBOnazXStqAaru%2F0dQpFLqPIzeuUjArnQmxksBCggTZ5sRxdrCZAnC3Wjg3Hfx0Mbw49FY9mlDZKWUaj1YxUeVlA3wpJ9wTwAnYI%2BJyNVRkUgASuOEDkGYDhE0Z9J9yjolQecRB1dVZsnqzv4Dsza1fUWuQENrNlkmCmV5yJIMb2a7zR997IdPo%2Fsyugj6yeAn0%3D--yjVFUWTB0JfpISA9--07cks1cvGN%2FUIJlFhyOYNQ%3D%3D; path=/; HttpOnly; SameSite=Lax
Keep-Alive: timeout=300, max=200
Connection: Keep-Alive
Transfer-Encoding: chunked
没有Content-Type
,所以浏览器尝试下载它。
知道这可能是什么原因吗?
编辑:我注意到 Link
header 很大并且被 Apache 截断了,所以我将 Header unset Link
添加到我的虚拟主机配置中。没有发送了,问题依旧
找到问题了。
Rails 最近开始发送包含所有资源的 Link
header,以便浏览器可以预加载它们。 See this PR.
问题是在开发过程中 header 会变得相当大(就像我的管理页面一样)。 Puma 与巨人 header 配合得很好,但 Apache 将 header 截断为 8 KiB(其中 7.58 是截断的 Link
header)并且不发送一个完整的响应,因此缺少 Content-Type
.
我只是通过将此添加到 config/environments/development.rb
来禁用 Rails (see this PR) 中的功能:
config.action_view.preload_links_header = false
并重新启动服务器。
这在生产中不太可能成为问题,因为资产通常会进行预编译和连接。