{"action":"created","issue":{"url":"https://api.github.com/repos/iron-meteor/iron-router/issues/1536","repository_url":"https://api.github.com/repos/iron-meteor/iron-router","labels_url":"https://api.github.com/repos/iron-meteor/iron-router/issues/1536/labels{/name}","comments_url":"https://api.github.com/repos/iron-meteor/iron-router/issues/1536/comments","events_url":"https://api.github.com/repos/iron-meteor/iron-router/issues/1536/events","html_url":"https://github.com/iron-meteor/iron-router/issues/1536","id":156149257,"number":1536,"title":" 404 pages came up  when use nginx and iron router in meteor application ","user":{"login":"Jerret321","id":2155745,"avatar_url":"https://avatars.githubusercontent.com/u/2155745?v=3","gravatar_id":"","url":"https://api.github.com/users/Jerret321","html_url":"https://github.com/Jerret321","followers_url":"https://api.github.com/users/Jerret321/followers","following_url":"https://api.github.com/users/Jerret321/following{/other_user}","gists_url":"https://api.github.com/users/Jerret321/gists{/gist_id}","starred_url":"https://api.github.com/users/Jerret321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jerret321/subscriptions","organizations_url":"https://api.github.com/users/Jerret321/orgs","repos_url":"https://api.github.com/users/Jerret321/repos","events_url":"https://api.github.com/users/Jerret321/events{/privacy}","received_events_url":"https://api.github.com/users/Jerret321/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-22T12:12:42Z","updated_at":"2016-05-22T12:36:34Z","closed_at":"2016-05-22T12:36:34Z","body":"404 Not Found, on nginx/1.9.12\r\n**ngnix config**\r\n```bash\r\nserver {\r\n    listen 1234;\r\n    server_name mydomain.com;\r\n    root my_app_dir/bundle/programs/web.browser;\r\n    set $port 4321;\r\n\r\n    #index index.js index.html index.htm;\r\n    #if ( -f $request_filename/index.html ){\r\n    #    rewrite (.*) $1/index.html break;\r\n    #}\r\n    #if ( !-f $request_filename ){\r\n    #    rewrite (.*) /index.js;\r\n    #}\r\n\r\n\r\n    location = / {\r\n\r\n        proxy_pass http://127.0.0.1:$port$request_uri;\r\n        proxy_http_version 1.1;\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\r\n        proxy_set_header Host $http_host;\r\n        proxy_set_header X-NginX-Proxy true;\r\n        proxy_set_header Upgrade $http_upgrade;\r\n        proxy_set_header Connection \"upgrade\";\r\n        proxy_redirect off;\r\n    }\r\n    # sockjs\r\n    location /sockjs {\r\n        proxy_pass http://127.0.0.1:$port$request_uri;\r\n        proxy_http_version 1.1;\r\n        proxy_set_header Upgrade $http_upgrade;\r\n        proxy_set_header Connection $connection_upgrade;\r\n        proxy_set_header Host $http_host;\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_redirect off;\r\n    }\r\n\r\n     # websocket\r\n    location /websocket {\r\n        proxy_pass http://127.0.0.1:$port$request_uri;\r\n        proxy_http_version 1.1;\r\n        proxy_set_header Upgrade $http_upgrade;\r\n        proxy_set_header Connection $connection_upgrade;\r\n        proxy_set_header Host $http_host;\r\n        proxy_set_header X-Real-IP $remote_addr;\r\n        proxy_redirect off;\r\n    }\r\n    #try_files $uri @files;\r\n    # files\r\n    \r\n    # attach\r\n    # excel\r\n    location ~* \\.(?:css|js)$ {\r\n\troot my_app_dir/bundle/programs/web.browser/;\r\n        expires 1y;\r\n        access_log off;\r\n        add_header Cache-Control \"public\";\r\n    }\t\r\n    location ~ ^/(logo|excel|attach|user){\r\n\troot /files;\r\n        expires 1y;\r\n        access_log off;\r\n        add_header Cache-Control \"public\";\r\n    }\r\n    location ~ \\.(jpg|jpeg|png|gif|mp3|ico|pdf|woff|ttf)$ {\r\n\troot my_app_dir/bundle/programs/web.browser/app/;\r\n        access_log off;\r\n        expires 30d;\r\n        add_header Pragma public;\r\n        add_header Cache-Control \"public\";\r\n    }\r\n\r\n    ## serve static files from packages by nginx instead of Meteor\r\n    location ^~ /packages {\r\n    # this should point at the content from the app folder\r\n\troot my_app_dir/bundle/programs/web.browser/;\r\n        access_log off;\r\n        expires 30d;\r\n        add_header Pragma public;\r\n        add_header Cache-Control \"public\";\r\n    }\r\n    # cache public resource\r\n    location ~ /public/ {\r\n        etag         on;\r\n        expires      max;\r\n    }\r\n\r\n}   \r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/iron-meteor/iron-router/issues/comments/220830169","html_url":"https://github.com/iron-meteor/iron-router/issues/1536#issuecomment-220830169","issue_url":"https://api.github.com/repos/iron-meteor/iron-router/issues/1536","id":220830169,"user":{"login":"Jerret321","id":2155745,"avatar_url":"https://avatars.githubusercontent.com/u/2155745?v=3","gravatar_id":"","url":"https://api.github.com/users/Jerret321","html_url":"https://github.com/Jerret321","followers_url":"https://api.github.com/users/Jerret321/followers","following_url":"https://api.github.com/users/Jerret321/following{/other_user}","gists_url":"https://api.github.com/users/Jerret321/gists{/gist_id}","starred_url":"https://api.github.com/users/Jerret321/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jerret321/subscriptions","organizations_url":"https://api.github.com/users/Jerret321/orgs","repos_url":"https://api.github.com/users/Jerret321/repos","events_url":"https://api.github.com/users/Jerret321/events{/privacy}","received_events_url":"https://api.github.com/users/Jerret321/received_events","type":"User","site_admin":false},"created_at":"2016-05-22T12:36:34Z","updated_at":"2016-05-22T12:36:34Z","body":"I have solved this question on  [#5769](https://github.com/meteor/meteor/issues/5769#issuecomment-210425109)"}}
{"actor":{"display_login":"Jerret321"}}