{"action":"created","issue":{"url":"https://api.github.com/repos/h2o/h2o/issues/1301","repository_url":"https://api.github.com/repos/h2o/h2o","labels_url":"https://api.github.com/repos/h2o/h2o/issues/1301/labels{/name}","comments_url":"https://api.github.com/repos/h2o/h2o/issues/1301/comments","events_url":"https://api.github.com/repos/h2o/h2o/issues/1301/events","html_url":"https://github.com/h2o/h2o/issues/1301","id":228575115,"number":1301,"title":"Can't add headers in host level with .php index file","user":{"login":"xm74","id":18723664,"avatar_url":"https://avatars2.githubusercontent.com/u/18723664?v=3","gravatar_id":"","url":"https://api.github.com/users/xm74","html_url":"https://github.com/xm74","followers_url":"https://api.github.com/users/xm74/followers","following_url":"https://api.github.com/users/xm74/following{/other_user}","gists_url":"https://api.github.com/users/xm74/gists{/gist_id}","starred_url":"https://api.github.com/users/xm74/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xm74/subscriptions","organizations_url":"https://api.github.com/users/xm74/orgs","repos_url":"https://api.github.com/users/xm74/repos","events_url":"https://api.github.com/users/xm74/events{/privacy}","received_events_url":"https://api.github.com/users/xm74/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-14T22:34:53Z","updated_at":"2017-05-15T06:38:42Z","closed_at":null,"body":"See a strange H2O 2.2.2 behavior under FreeBSD. If site using PHP file as index than there is no possibility to add headers at host level. In other case when site usin index.html all works fine. PHP processing goes via file.custom-handler\r\n> ...\r\nfile.custom-handler:\r\n    extension: \".php\"\r\n    fastcgi.connect:\r\n        host: 127.0.0.1\r\n        port: 9000\r\n        type: tcp\r\n...\r\n\r\nHere is two sites. First don't using PHP index, and second does.\r\n>    \"first:443\":\r\n        header.add: \"Strict-Transport-Security: max-age=15768000; includeSubDomains; preload\"\r\n        listen:\r\n            port: 443\r\n            ssl:\r\n                 certificate-file: /usr/local/etc/letsencrypt/live/first/fullchain.pem\r\n                 key-file: /usr/local/etc/letsencrypt/live/first/privkey.pem\r\n        paths:\r\n            \"/\":\r\n                file.dir: /usr/local/www/first\r\n    \"second:443\":\r\n        header.add: \"Strict-Transport-Security: max-age=15768000; includeSubDomains; preload\"\r\n        listen:\r\n            port: 443\r\n            ssl:\r\n                 certificate-file: /usr/local/etc/letsencrypt/live/second/fullchain.pem\r\n                 key-file: /usr/local/etc/letsencrypt/live/second/privkey.pem\r\n        paths:\r\n            \"/\":\r\n                file.dir: /usr/local/www/second\r\n\r\nAnswers:\r\n>--- curl -I https://first\r\nHTTP/2 200\r\nserver: h2o/2.2.2\r\ndate: Sun, 14 May 2017 22:39:37 GMT\r\ncontent-type: text/html\r\nlast-modified: Mon, 11 Jul 2016 17:55:34 GMT\r\netag: \"5783dd96-38bd\"\r\nvary: accept-encoding\r\naccept-ranges: bytes\r\nstrict-transport-security: max-age=15768000; includeSubDomains; preload\r\ncontent-length: 14525\r\n--- curl -I https://second\r\nHTTP/2 200\r\nserver: h2o/2.2.2\r\ndate: Sun, 14 May 2017 22:39:14 GMT\r\nx-powered-by: PHP/5.6.30\r\nset-cookie: second_sessid=ea46d7ad1cb3766feb70e741efb59e9b; path=/; secure; HttpOnly\r\nexpires: Sun, 14 May 2017 22:39:14 GMT\r\nlast-modified: Sun, 14 May 2017 22:39:14 GMT\r\ncache-control: private, no-cache, no-store, must-revalidate, post-check=0, pre-check=0\r\npragma: no-cache\r\nx-dns-prefetch-control: off\r\nx-frame-options: sameorigin\r\ncontent-language: en\r\ncontent-type: text/html; charset=UTF-8\r\n"},"comment":{"url":"https://api.github.com/repos/h2o/h2o/issues/comments/301388825","html_url":"https://github.com/h2o/h2o/issues/1301#issuecomment-301388825","issue_url":"https://api.github.com/repos/h2o/h2o/issues/1301","id":301388825,"user":{"login":"utrenkner","id":8254715,"avatar_url":"https://avatars2.githubusercontent.com/u/8254715?v=3","gravatar_id":"","url":"https://api.github.com/users/utrenkner","html_url":"https://github.com/utrenkner","followers_url":"https://api.github.com/users/utrenkner/followers","following_url":"https://api.github.com/users/utrenkner/following{/other_user}","gists_url":"https://api.github.com/users/utrenkner/gists{/gist_id}","starred_url":"https://api.github.com/users/utrenkner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/utrenkner/subscriptions","organizations_url":"https://api.github.com/users/utrenkner/orgs","repos_url":"https://api.github.com/users/utrenkner/repos","events_url":"https://api.github.com/users/utrenkner/events{/privacy}","received_events_url":"https://api.github.com/users/utrenkner/received_events","type":"User","site_admin":false},"created_at":"2017-05-15T06:38:42Z","updated_at":"2017-05-15T06:38:42Z","body":"I just tested it and can confirm the issue of @xm74 . \r\n\r\nChanging from ``header.add`` to ``header.set`` does not make any difference on my test-server (h2o/2.2.2 on FreeBSD 11.0-RELEASE)."}}
{"actor":{"display_login":"utrenkner"}}