@dovid נו, הבאת שני מראי מקומות כמוני... מסתבר שגם העובדות הם ככה, לא?
This means that you don't need separate allow / deny directives inside your configuration with your use case, because the connections are limited lower in the network stack.
So, if you want to set nginx to bind to localhost, you'd change that to: listen 127.0.0.1:80;
In this way, requests that are not coming from localhost are discarded (they don't even hit nginx).
למעשה לא הבנתי מתוך השאלה מה עיקר הבעיה, העיקר שלא תצטרך DNS להגיע לשרת? אז תכתוב
server_name localhost
אתה רוצה למנוע גישה מבחוץ, ואתה לא מאמין ש:listen 127.0.0.1
מספיק? תשתמש בחומת האש.
אתה צריך דוקא "במקטע server אחד להאזין לפורט אחד דוקא בהינתן server_name מסויים, ולאחר בכל מקרה"? אז נראה שבאמת אין אפשרות כזו.